分润功能log
This commit is contained in:
parent
45564895b9
commit
d9e61e3195
|
@ -5,6 +5,7 @@ namespace app\api\controller;
|
||||||
use app\adminapi\logic\user\UserLogic;
|
use app\adminapi\logic\user\UserLogic;
|
||||||
use app\common\logic\ShopRequestLogic;
|
use app\common\logic\ShopRequestLogic;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
|
use think\facade\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商城主动调用接口类
|
* 商城主动调用接口类
|
||||||
|
@ -20,8 +21,8 @@ class ShopCallController extends BaseApiController
|
||||||
$this->apiSecret = config('project.shop_api_secret');
|
$this->apiSecret = config('project.shop_api_secret');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 用户首单分润
|
* 用户直推首单分润
|
||||||
* 队 村 镇三级分润
|
*
|
||||||
*/
|
*/
|
||||||
public function user_first_order_share_profit()
|
public function user_first_order_share_profit()
|
||||||
{
|
{
|
||||||
|
@ -33,7 +34,7 @@ class ShopCallController extends BaseApiController
|
||||||
$iv = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
$iv = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
||||||
// $secretData = encrypt($params['data'], $this->apiSecret, $iv); halt($secretData);
|
// $secretData = encrypt($params['data'], $this->apiSecret, $iv); halt($secretData);
|
||||||
$requestDatas = decrypt($params['data'], $this->apiSecret, $iv);
|
$requestDatas = decrypt($params['data'], $this->apiSecret, $iv);
|
||||||
|
Log::info('首单分润请求参数:'.json_encode($requestDatas));
|
||||||
if (null === $requestDatas) {
|
if (null === $requestDatas) {
|
||||||
return $this->fail('非法访问,解析失败');
|
return $this->fail('非法访问,解析失败');
|
||||||
}
|
}
|
||||||
|
@ -45,7 +46,7 @@ class ShopCallController extends BaseApiController
|
||||||
|
|
||||||
// 推广人
|
// 推广人
|
||||||
$userSelf = UserLogic::getUserByInviteCode($inviteCode);
|
$userSelf = UserLogic::getUserByInviteCode($inviteCode);
|
||||||
if (empty($userSelf)) {
|
if ($userSelf->isEmpty()) {
|
||||||
return $this->fail('推广人不存在');
|
return $this->fail('推广人不存在');
|
||||||
}
|
}
|
||||||
$proportion = 0.03;
|
$proportion = 0.03;
|
||||||
|
@ -73,7 +74,7 @@ class ShopCallController extends BaseApiController
|
||||||
$iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
$iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
||||||
$encryptStr = encrypt($request, $this->apiSecret, $iv1);
|
$encryptStr = encrypt($request, $this->apiSecret, $iv1);
|
||||||
$res = ShopRequestLogic::userProfitNotice(['data' => $encryptStr, 'timestamp' => $timestamp]);
|
$res = ShopRequestLogic::userProfitNotice(['data' => $encryptStr, 'timestamp' => $timestamp]);
|
||||||
|
Log::info('首单分润通知商城返回:'.json_encode($res));
|
||||||
return $this->success('成功');
|
return $this->success('成功');
|
||||||
|
|
||||||
// 推广人角色 - 小队/小区队长
|
// 推广人角色 - 小队/小区队长
|
||||||
|
@ -180,6 +181,7 @@ class ShopCallController extends BaseApiController
|
||||||
$timestamp = $params['timestamp'];
|
$timestamp = $params['timestamp'];
|
||||||
$iv = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
$iv = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
||||||
$requestDatas = decrypt($params['data'], $this->apiSecret, $iv);
|
$requestDatas = decrypt($params['data'], $this->apiSecret, $iv);
|
||||||
|
Log::info('镇合伙人,配送员分润请求参数:'.json_encode($requestDatas));
|
||||||
if (null === $requestDatas) {
|
if (null === $requestDatas) {
|
||||||
return $this->fail('非法访问,解析失败');
|
return $this->fail('非法访问,解析失败');
|
||||||
}
|
}
|
||||||
|
@ -215,7 +217,7 @@ class ShopCallController extends BaseApiController
|
||||||
$iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
$iv1 = substr(md5($this->apiSecret.$timestamp), 5, 16);
|
||||||
$encryptStr = encrypt($request, $this->apiSecret, $iv1);
|
$encryptStr = encrypt($request, $this->apiSecret, $iv1);
|
||||||
$res = ShopRequestLogic::userProfitNotice(['data' => $encryptStr, 'timestamp' => $timestamp]);
|
$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)]);
|
return $this->success('成功', ['user_id' => $userSelf['id'], 'account' => $userSelf['account'], 'user_profit' => bcmul($orderMoney, $proportion, 2)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue