|
|
@@ -495,17 +495,16 @@ class User extends \common\components\ActiveRecord
|
|
|
$periodList = implode("','", $periodList);
|
|
|
|
|
|
// 条件2: 任意水机分期+150粒的EKSP(HES150N)
|
|
|
- $query = Order::find()
|
|
|
+ $orderEKSP = Order::find()
|
|
|
->alias('O')
|
|
|
->select('O.SN')
|
|
|
->join('INNER JOIN', OrderGoods::tableName() . ' AS G', 'O.SN = G.ORDER_SN')
|
|
|
->where("O.IS_DELETE=0 AND O.USER_ID=:USER_ID AND O.PERIOD_NUM IN ('{$periodList}') AND G.SKU_CODE=:SKU_CODE",
|
|
|
- ['USER_ID' => $userId, ':SKU_CODE' => 'HES150N']);
|
|
|
-
|
|
|
-
|
|
|
- $orderEKSP = $query->column();
|
|
|
+ ['USER_ID' => $userId, ':SKU_CODE' => 'HES150N'])
|
|
|
+ ->asArray()
|
|
|
+ ->all();
|
|
|
if (!count($orderEKSP)) {
|
|
|
- LoggerTool::debug('isPerfActive-2: ' . $userId . ': ' . $query->createCommand()->getRawSql() . ' ' . "O.IS_DELETE=0 AND O.USER_ID=:USER_ID AND O.PERIOD_NUM IN ('{$periodList}') AND G.SKU_CODE=:SKU_CODE");
|
|
|
+ LoggerTool::debug('isPerfActive-2: ' . $userId . ': ' . json_encode($orderEKSP));
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -518,7 +517,8 @@ class User extends \common\components\ActiveRecord
|
|
|
->select('O.SN')
|
|
|
->join('INNER JOIN', OrderGoods::tableName() . ' AS G', 'O.SN = G.ORDER_SN')
|
|
|
->where("O.IS_DELETE=0 AND O.USER_ID=:USER_ID AND O.PERIOD_NUM ('{$periodList}') AND G.SKU_CODE IN ('{$instalmentShopGoods}')", ['USER_ID' => $userId])
|
|
|
- ->column();
|
|
|
+ ->asArray()
|
|
|
+ ->all();
|
|
|
if (!count($orderInstalment)) {
|
|
|
LoggerTool::debug('isPerfActive-3: ' . $userId . ': ' . json_encode($orderInstalment));
|
|
|
return 0;
|