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; // 比例
$noticeUser = [];
// 计算分润
if (!empty($userSelf)) {
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;
$timestamp = time();
$iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16);

View File

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