From f1e8b69b5842aba3d7fc6efc824a07eb26a8ff96 Mon Sep 17 00:00:00 2001 From: tping Date: Mon, 18 May 2020 11:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=86=99=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=EF=BC=8C=E4=B8=BB=E4=BB=8E=E5=90=8C=E6=AD=A5=E5=BB=B6=E8=BF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/BaseController.class.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Application/Callback/Controller/BaseController.class.php b/Application/Callback/Controller/BaseController.class.php index d19261f4..bb99fd92 100644 --- a/Application/Callback/Controller/BaseController.class.php +++ b/Application/Callback/Controller/BaseController.class.php @@ -506,20 +506,21 @@ class BaseController extends Controller { * @return bool * author: xmy 280564871@qq.com */ - protected function rechargeAwardPoint($user_id,$pay_amount){ + protected function rechargeAwardPoint($user_id, $pay_amount){ $point_recorddd=M('point_record','tab_'); - $user = M("user","tab_")->find($user_id); - if(empty($user_id)){ - return true; - } +// $user = M("user","tab_")->find($user_id); +// if(empty($user_id)){ +// return true; +// } //奖励用户积分 $point_type = $this->getPointType("recharge_spend"); $point = intval($point_type['point'] * $pay_amount); $point_recorddd->startTrans(); + $user_result = false; if($point > 0){ - $user['point'] += $point; +// $user['point'] += $point; //积分记录 $data['user_id'] = $user_id; @@ -528,8 +529,10 @@ class BaseController extends Controller { $data['create_time'] = time(); $data['type'] = 1; $point_result = M("point_record","tab_")->add($data);//积分记录存储 + $user_result = M("user","tab_")->where(array( + 'id' => $user_id + ))->setInc("point", $point);//被邀请人积分存储 } - $user_result = M("user","tab_")->save($user);//被邀请人积分存储 if($point_result === false || $user_result === false){ $point_recorddd->rollback();