|
|
|
@ -153,7 +153,6 @@ class Order extends BaseModel |
|
|
|
|
*/ |
|
|
|
|
private static function calculateGoodsCapital(array $setting, OrderGoodsModel $goods, string $goodsPrice): array |
|
|
|
|
{ |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($setting), 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
$arr = [ |
|
|
|
|
'first_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['first_money'], 1000)), |
|
|
|
|
'second_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['second_money'], 1000)), |
|
|
|
@ -161,11 +160,8 @@ class Order extends BaseModel |
|
|
|
|
]; |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => 'arr数据', 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($arr), 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => '商品数据', 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($goods), 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
// 判断是否开启商品单独分销 |
|
|
|
|
if (!$goods['is_ind_dealer']) { |
|
|
|
|
|
|
|
|
|
// 全局分销比例 |
|
|
|
|
return [ |
|
|
|
|
'first_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['first_money'], 100)), |
|
|
|
|