diff --git a/app/common/model/dealer/Order.php b/app/common/model/dealer/Order.php index 1ec77593..6f51ef2d 100644 --- a/app/common/model/dealer/Order.php +++ b/app/common/model/dealer/Order.php @@ -153,16 +153,19 @@ 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'], 100)), + 'second_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['second_money'], 100)), + 'third_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['third_money'], 100)) + ]; + 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']) { - 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'], 100)), - 'second_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['second_money'], 100)), - 'third_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['third_money'], 100)) - ]; - 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')]); + // 全局分销比例 return [ 'first_money' => helper::bcmul($goodsPrice, helper::bcdiv($setting['first_money'], 100)),