From d9e61e3195a2ec9553e0d5d202beff7f6a1814e0 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 26 Jan 2024 11:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=B6=A6=E5=8A=9F=E8=83=BDlog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/ShopCallController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/api/controller/ShopCallController.php b/app/api/controller/ShopCallController.php index c24d3be3..24d95092 100644 --- a/app/api/controller/ShopCallController.php +++ b/app/api/controller/ShopCallController.php @@ -5,6 +5,7 @@ namespace app\api\controller; use app\adminapi\logic\user\UserLogic; use app\common\logic\ShopRequestLogic; use think\exception\ValidateException; +use think\facade\Log; /** * 商城主动调用接口类 @@ -20,8 +21,8 @@ class ShopCallController extends BaseApiController $this->apiSecret = config('project.shop_api_secret'); } /** - * 用户首单分润 - * 队 村 镇三级分润 + * 用户直推首单分润 + * */ public function user_first_order_share_profit() { @@ -33,7 +34,7 @@ class ShopCallController extends BaseApiController $iv = substr(md5($this->apiSecret.$timestamp), 5, 16); // $secretData = encrypt($params['data'], $this->apiSecret, $iv); halt($secretData); $requestDatas = decrypt($params['data'], $this->apiSecret, $iv); - + Log::info('首单分润请求参数:'.json_encode($requestDatas)); if (null === $requestDatas) { return $this->fail('非法访问,解析失败'); } @@ -45,7 +46,7 @@ class ShopCallController extends BaseApiController // 推广人 $userSelf = UserLogic::getUserByInviteCode($inviteCode); - if (empty($userSelf)) { + if ($userSelf->isEmpty()) { return $this->fail('推广人不存在'); } $proportion = 0.03; @@ -73,7 +74,7 @@ class ShopCallController extends BaseApiController $iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16); $encryptStr = encrypt($request, $this->apiSecret, $iv1); $res = ShopRequestLogic::userProfitNotice(['data' => $encryptStr, 'timestamp' => $timestamp]); - + Log::info('首单分润通知商城返回:'.json_encode($res)); return $this->success('成功'); // 推广人角色 - 小队/小区队长 @@ -180,6 +181,7 @@ class ShopCallController extends BaseApiController $timestamp = $params['timestamp']; $iv = substr(md5($this->apiSecret.$timestamp), 5, 16); $requestDatas = decrypt($params['data'], $this->apiSecret, $iv); + Log::info('镇合伙人,配送员分润请求参数:'.json_encode($requestDatas)); if (null === $requestDatas) { return $this->fail('非法访问,解析失败'); } @@ -215,7 +217,7 @@ class ShopCallController extends BaseApiController $iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16); $encryptStr = encrypt($request, $this->apiSecret, $iv1); $res = ShopRequestLogic::userProfitNotice(['data' => $encryptStr, 'timestamp' => $timestamp]); - + Log::info('镇合伙人,配送员分润通知商城返回:'.json_encode($res)); return $this->success('成功', ['user_id' => $userSelf['id'], 'account' => $userSelf['account'], 'user_profit' => bcmul($orderMoney, $proportion, 2)]); } } \ No newline at end of file