From 71df93a12fce7450036c31ab637c6b4feb16d481 Mon Sep 17 00:00:00 2001
From: chenxiaojun <956334972@qq.com>
Date: Mon, 2 Dec 2019 17:32:38 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E7=AE=A1=E7=90=86->=E5=85=85=E5=80=BC=E7=8E=A9?=
=?UTF-8?q?=E5=AE=B6--=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Admin/Controller/AutoController.class.php | 22 ++++++++++---------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index 4c8ee95ff..c704aec94 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -960,12 +960,14 @@ public function auto_rrdae(){
{
$map['promote_id'] = ['gt', 0];
$map['_string'] = "promote_account = '' or promote_account = '自然注册' or promote_account = '官方渠道' or promote_account is NULL";
- $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();
+ $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'];
@@ -974,7 +976,6 @@ public function auto_rrdae(){
$userAll = count($userData);
unset($userData);
- $userPlayModel = 'tab_user_play';
$userPlayRet = $this->updateUserPromoteAccountSql($userPlayModel, $userPlayData, $promoteData);
$userPlaySuccess = $userPlayRet['success'];
$userPlayError = $userPlayRet['error'];
@@ -983,7 +984,6 @@ public function auto_rrdae(){
$userPlayAll = count($userPlayData);
unset($userPlayData);
- $userPlayInfoModel = 'tab_user_play_info';
$userPlayInfoRet = $this->updateUserPromoteAccountSql($userPlayInfoModel, $userPlayInfoData, $promoteData);
$userPlayInfoSuccess = $userPlayInfoRet['success'];
$userPlayInfoError = $userPlayInfoRet['error'];
@@ -992,11 +992,11 @@ public function auto_rrdae(){
$userPlayInfoAll = count($userPlayInfoData);
unset($userPlayInfoData);
- echo $userModel . ":all--{$userAll} success--{$userSuccess} error--{$userError} error_ids--{$userErrorData}";
+ echo "tab_user:all--{$userAll} success--{$userSuccess} error--{$userError} error_ids--{$userErrorData}";
echo '
';
- echo $userPlayModel . ":all--{$userPlayAll} success--{$userPlaySuccess} error--{$userPlayError} error_ids--{$userPlayErrorData}";
+ echo "tab_user_play:all--{$userPlayAll} success--{$userPlaySuccess} error--{$userPlayError} error_ids--{$userPlayErrorData}";
echo '
';
- echo $userPlayInfoModel . ":all--{$userPlayInfoAll} success--{$userPlayInfoSuccess} error--{$userPlayInfoError} error_ids--{$userPlayInfoErrorData}";
+ echo "tab_user_play_info:all--{$userPlayInfoAll} success--{$userPlayInfoSuccess} error--{$userPlayInfoError} error_ids--{$userPlayInfoErrorData}";
echo '
';
}
@@ -1014,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'];