|
|
@@ -65,14 +65,8 @@ class StorePerfLog extends \common\components\ActiveRecord
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public static function addOrUpdate($periodNum, $calcMonth, $userId, $data, $appendPv = 0) {
|
|
|
- $info = StorePerfLog::findUseDbCalc()
|
|
|
- ->select('ID')
|
|
|
- ->where('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM AND CALC_MONTH=:CALC_MONTH',
|
|
|
- [':USER_ID'=>$userId,':PERIOD_NUM' => $periodNum, ':CALC_MONTH' => $calcMonth]
|
|
|
- )
|
|
|
- ->asArray()
|
|
|
- ->one();
|
|
|
- if (empty($info)) {
|
|
|
+ $info = StorePerfLog::findOneAsArray('USER_ID=:USER_ID AND PERIOD_NUM=:PERIOD_NUM AND CALC_MONTH=:CALC_MONTH', [':USER_ID'=>$userId,':PERIOD_NUM' => $periodNum, ':CALC_MONTH' => $calcMonth]);
|
|
|
+ if (!$info) {
|
|
|
StorePerfLog::insertOne($data);
|
|
|
} else {
|
|
|
// 如果循环到此用户有业绩单,则将此用户的PV更新为自己业绩单的值
|