update 用户首页

This commit is contained in:
chenbo 2024-01-21 17:50:49 +08:00
parent 44cc714be6
commit bb28bbd410
2 changed files with 14 additions and 15 deletions

View File

@ -196,15 +196,19 @@ class ShopCallController extends BaseApiController
$proportion = 0.01; // 比例 $proportion = 0.01; // 比例
$noticeUser = [];
// 计算分润 // 计算分润
UserLogic::userProfit($userSelf, $orderMoney, $proportion, $orderNo); if (!empty($userSelf)) {
UserLogic::userProfit($courier, $orderMoney, $proportion, $orderNo); UserLogic::userProfit($userSelf, $orderMoney, $proportion, $orderNo);
$noticeUser[] = ['type' => 3, 'account' => $userSelf['account'], 'user_profit' => bcmul($orderMoney, 0.01, 2)];
}
if (!empty($courier)) {
UserLogic::userProfit($courier, $orderMoney, $proportion, $orderNo);
$noticeUser[] = ['type' => 4, 'account' => $courier['account'], 'user_profit' => bcmul($orderMoney, 0.01, 2)];
}
$request['user'] = $noticeUser;
// 通知商城 // 通知商城
$request['user'] = [
['type' => 3, 'account' => $userSelf['account'], 'user_profit' => bcmul($orderMoney, 0.01, 2)],
['type' => 4, 'account' => $courier['account'], 'user_profit' => bcmul($orderMoney, 0.01, 2)],
];
$request['order_id'] = $orderId; $request['order_id'] = $orderId;
$timestamp = time(); $timestamp = time();
$iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16); $iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16);

View File

@ -247,14 +247,9 @@ class ShopRequestLogic extends BaseLogic
public static function userProfitNotice($param) public static function userProfitNotice($param)
{ {
try { $requestResponse = HttpClient::create()->request('POST', env('url.shop_prefix'). '/api/open/activityCommission', [
$requestResponse = HttpClient::create()->request('POST', env('url.shop_prefix'). '/api/open/activityCommission', [ 'body' => $param
'body' => $param ]);
]); return json_decode($requestResponse->getContent(), true);
return json_decode($requestResponse->getContent(), true);
} catch (Exception $e) {
self::setError($e->getMessage());
return false;
}
} }
} }