|
|
|
@ -959,41 +959,44 @@ public function auto_rrdae(){
|
|
|
|
|
public function updateUserPromoteAccount()
|
|
|
|
|
{
|
|
|
|
|
$map['promote_id'] = ['gt', 0];
|
|
|
|
|
$map['_string'] = "promote_account = '' or promote_account = '自然注册' or promote_account = '官方渠道'";
|
|
|
|
|
$userData = M('user', 'tab_')->field('id,promote_id')->where($map)->select();
|
|
|
|
|
$userPlayData = M('user_play', 'tab_')->field('id,promote_id')->where($map)->select();
|
|
|
|
|
$userPlayInfoData = M('user_play_info', 'tab_')->field('id,promote_id')->where($map)->select();
|
|
|
|
|
$map['_string'] = "promote_account = '' or promote_account = '自然注册' or promote_account = '官方渠道' or promote_account is NULL";
|
|
|
|
|
$userModel = M('user', 'tab_');
|
|
|
|
|
$userPlayModel = M('user_play', 'tab_');
|
|
|
|
|
$userPlayInfoModel = M('user_play_info', 'tab_');
|
|
|
|
|
$userData = $userModel->field('id,promote_id')->where($map)->select();
|
|
|
|
|
$userPlayData = $userPlayModel->field('id,promote_id')->where($map)->select();
|
|
|
|
|
$userPlayInfoData = $userPlayInfoModel->field('id,promote_id')->where($map)->select();
|
|
|
|
|
$promoteData = [];
|
|
|
|
|
|
|
|
|
|
$userModel = 'tab_user';
|
|
|
|
|
$userRet = $this->updateUserPromoteAccountSql($userModel, $userData, $promoteData);
|
|
|
|
|
$userSuccess = $userRet['success'];
|
|
|
|
|
$userError = $userRet['error'];
|
|
|
|
|
$userErrorData = empty($userRet['error_data']) ? '' : implode(',', $userRet['error_data']);
|
|
|
|
|
$promoteData = $userRet['promote_data'];
|
|
|
|
|
$userAll = count($userData);
|
|
|
|
|
unset($userData);
|
|
|
|
|
|
|
|
|
|
$userPlayModel = 'tab_user_play';
|
|
|
|
|
$userPlayRet = $this->updateUserPromoteAccountSql($userPlayModel, $userData, $promoteData);
|
|
|
|
|
$userPlayRet = $this->updateUserPromoteAccountSql($userPlayModel, $userPlayData, $promoteData);
|
|
|
|
|
$userPlaySuccess = $userPlayRet['success'];
|
|
|
|
|
$userPlayError = $userPlayRet['error'];
|
|
|
|
|
$userPlayErrorData = empty($userPlayRet['error_data']) ? '' : implode(',', $userPlayRet['error_data']);
|
|
|
|
|
$promoteData = $userPlayRet['promote_data'];
|
|
|
|
|
$userPlayAll = count($userPlayData);
|
|
|
|
|
unset($userPlayData);
|
|
|
|
|
|
|
|
|
|
$userPlayInfoModel = 'tab_user_play_info';
|
|
|
|
|
$userPlayInfoRet = $this->updateUserPromoteAccountSql($userPlayInfoModel, $userData, $promoteData);
|
|
|
|
|
$userPlayInfoRet = $this->updateUserPromoteAccountSql($userPlayInfoModel, $userPlayInfoData, $promoteData);
|
|
|
|
|
$userPlayInfoSuccess = $userPlayInfoRet['success'];
|
|
|
|
|
$userPlayInfoError = $userPlayInfoRet['error'];
|
|
|
|
|
$userPlayInfoErrorData = empty($userPlayInfoRet['error_data']) ? '' : implode(',', $userPlayInfoRet['error_data']);
|
|
|
|
|
$promoteData = $userPlayInfoRet['promote_data'];
|
|
|
|
|
$userPlayInfoAll = count($userPlayInfoData);
|
|
|
|
|
unset($userPlayInfoData);
|
|
|
|
|
|
|
|
|
|
echo $userModel . ":all--{$userAll} success--{$userSuccess} error--{$userError} error_data--{$userErrorData}";
|
|
|
|
|
echo "tab_user:all--{$userAll} success--{$userSuccess} error--{$userError} error_ids--{$userErrorData}";
|
|
|
|
|
echo '<br>';
|
|
|
|
|
echo $userPlayModel . ":all--{$userPlayAll} success--{$userPlaySuccess} error--{$userPlayError} error_data--{$userPlayErrorData}";
|
|
|
|
|
echo "tab_user_play:all--{$userPlayAll} success--{$userPlaySuccess} error--{$userPlayError} error_ids--{$userPlayErrorData}";
|
|
|
|
|
echo '<br>';
|
|
|
|
|
echo $userPlayInfoModel . ":all--{$userPlayInfoAll} success--{$userPlayInfoSuccess} error--{$userPlayInfoError} error_data--{$userPlayInfoErrorData}";
|
|
|
|
|
echo "tab_user_play_info:all--{$userPlayInfoAll} success--{$userPlayInfoSuccess} error--{$userPlayInfoError} error_ids--{$userPlayInfoErrorData}";
|
|
|
|
|
echo '<br>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1011,7 +1014,9 @@ public function auto_rrdae(){
|
|
|
|
|
$promoteData[$list['promote_id']] = $promoteAccount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$res = M()->query("update `$model` set promote_account = '{$promoteAccount}' where id = {$list['id']}");
|
|
|
|
|
$save['id'] = $list['id'];
|
|
|
|
|
$save['promote_account'] = $promoteAccount;
|
|
|
|
|
$res = $model->save($save);
|
|
|
|
|
if ($res === false) {
|
|
|
|
|
$error++;
|
|
|
|
|
$errorData = $list['id'];
|
|
|
|
|