parent
4c9a1153f2
commit
22c84e4cd8
|
|
@ -48,22 +48,24 @@ class SparateLegumesJob implements JobInterface{
|
||||||
foreach($orderList as $orderInfo){
|
foreach($orderList as $orderInfo){
|
||||||
// 获取平台抽成信息
|
// 获取平台抽成信息
|
||||||
$platformCommissionInfo = $platformCommissionRecord[$orderInfo['order_id']] ?? [];
|
$platformCommissionInfo = $platformCommissionRecord[$orderInfo['order_id']] ?? [];
|
||||||
// 计算订单金额占比 必须进行100的偏移计算
|
if($platformCommissionInfo){
|
||||||
// $rate = (float)sprintf("%.3f",$orderInfo['sum_money'] / $totalMoney * 100);
|
// 计算订单金额占比 必须进行100的偏移计算
|
||||||
$rate = (float)sprintf("%.3f",$platformCommissionInfo['platform_commission_money'] / $totalPlatformCommission * 100);
|
// $rate = (float)sprintf("%.3f",$orderInfo['sum_money'] / $totalMoney * 100);
|
||||||
$getLegumes = sprintf("%.3f",$cycleLegumes['legumes_num'] * $rate / 100);
|
$rate = (float)sprintf("%.3f",$platformCommissionInfo['platform_commission_money'] / $totalPlatformCommission * 100);
|
||||||
// 信息记录
|
$getLegumes = sprintf("%.3f",$cycleLegumes['legumes_num'] * $rate / 100);
|
||||||
$insertData[] = [
|
// 信息记录
|
||||||
'uid' => $orderInfo['uid'],
|
$insertData[] = [
|
||||||
'legumes_id' => $data['legumes_id'],
|
'uid' => $orderInfo['uid'],
|
||||||
'order_id' => $orderInfo['order_id'],
|
'legumes_id' => $data['legumes_id'],
|
||||||
'cycle_total_legumes' => $cycleLegumes['legumes_num'],
|
'order_id' => $orderInfo['order_id'],
|
||||||
'total_sales_money' => $totalMoney,
|
'cycle_total_legumes' => $cycleLegumes['legumes_num'],
|
||||||
'order_money' => $orderInfo['sum_money'],
|
'total_sales_money' => $totalMoney,
|
||||||
'order_money_rate' => $rate,
|
'order_money' => $orderInfo['sum_money'],
|
||||||
'get_legumes' => $getLegumes,
|
'order_money_rate' => $rate,
|
||||||
'status' => in_array((int)$orderInfo['status'],[2,3]) ? 1 : 0,
|
'get_legumes' => $getLegumes,
|
||||||
];
|
'status' => in_array((int)$orderInfo['status'],[2,3]) ? 1 : 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 添加数据
|
// 添加数据
|
||||||
if(count($insertData) > 0) app()->make(LegumesLogRepository::class)->insertAll($insertData);
|
if(count($insertData) > 0) app()->make(LegumesLogRepository::class)->insertAll($insertData);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ return [
|
||||||
'password' => env('redis.redis_password', ''),
|
'password' => env('redis.redis_password', ''),
|
||||||
// 数据库 0号数据库
|
// 数据库 0号数据库
|
||||||
'select' => (int)env('redis.select', 0),
|
'select' => (int)env('redis.select', 0),
|
||||||
|
'prefix' => 'zcgs:',
|
||||||
|
'tag_prefix'=> 'zcgs:'
|
||||||
],
|
],
|
||||||
// 更多的缓存连接
|
// 更多的缓存连接
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ return [
|
||||||
'select' => (int)env('redis.select', 0),
|
'select' => (int)env('redis.select', 0),
|
||||||
'timeout' => 0,
|
'timeout' => 0,
|
||||||
'persistent' => false,
|
'persistent' => false,
|
||||||
|
'prefix' => 'zcgs:',
|
||||||
|
'tag_prefix'=> 'zcgs:'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'failed' => [
|
'failed' => [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue