$this->site_id,//站点id // 'sku_array' => [["sku_id" => 9399,"num" => 1],["sku_id" => 9400,"num" => 1]], 'sku_array' => [ [ "money" => 1000, "num" => 1 ] ], 'member_id' => 555,//购买会员(可有可无) 'store_id' => 1, 'mobile' => '', 'order_from' => 'h5', 'order_from_name' => 'h5', 'type' => 'recharge', 'source' => $this->params[ 'source' ] ?? '',// is_buy 普通购买 cart 购物车 ‘’ 参与活动, 'cashier_type' => 'cashier', 'create_time' => time(), ]; $res = $order_create_model->create($data); dd($res); } public function test1() { $promotion = [ 'reduction' => 20 ]; $data = array ( 'pay_type' => '', 'site_id' => $this->site_id,//站点id 'out_trade_no' => '166391531754635551000', 'store_id' => 1, 'promotion' => $promotion, 'member_id' => 555, 'cash' => 20 ); $cashier_order_calculate_model = new CashierOrderCalculate(); dd($result = $cashier_order_calculate_model->calculate($data)); } public function test3() { $promotion = !empty($this->params[ 'promotion' ]) ? json_decode($this->params[ 'promotion' ], true) : []; $cashier_order_pay_model = new CashierOrderPay(); $data = array ( 'pay_type' => 'cash', 'site_id' => $this->site_id,//站点id 'out_trade_no' => '166401355934055551000', 'store_id' => 1, 'promotion' => $promotion, 'member_id' => 555, 'cash' => 20000 ); $result = $cashier_order_pay_model->confirm($data); dd($result); } }