[ 'name' => '收银台' ] ]; public $order_status = [ self::ORDER_CREATE => [ 'status' => self::ORDER_CREATE, 'name' => '待支付', 'is_allow_refund' => 0, 'icon' => 'public/uniapp/order/order-icon.png', 'action' => [ [ 'action' => 'orderClose', 'title' => '关闭订单', 'color' => '' ] ], 'member_action' => [ [ 'action' => 'orderClose', 'title' => '关闭订单', 'color' => '' ], ], 'color' => '' ], self::ORDER_COMPLETE => [ 'status' => self::ORDER_COMPLETE, 'name' => '已完成', 'is_allow_refund' => 1, 'icon' => 'public/uniapp/order/order-icon-received.png', 'action' => [ ], 'member_action' => [ ], 'color' => '' ], self::ORDER_CLOSE => [ 'status' => self::ORDER_CLOSE, 'name' => '已关闭', 'is_allow_refund' => 0, 'icon' => 'public/uniapp/order/order-icon-close.png', 'action' => [ ], 'member_action' => [ ], 'color' => '' ], ]; public $pay_type = array ( 'cash' => '现金支付', 'BALANCE' => '余额支付', 'own_wechatpay' => '个人微信', 'own_alipay' => '个人支付宝', 'own_pos' => '个人pos刷卡', 'ONLINE_PAY' => '在线支付', ); public $cashier_order_type = [ 'goods' => '消费', 'card' => '售卡', 'recharge' => '充值', ]; //todo 切勿调用,占位 public $delivery_status_list = array ( 0 => '待发货', 1 => '已发货', 2 => '已收货' ); public function getPayType($params = []) { return $this->pay_type; } public function getCashierOrderType() { return $this->cashier_order_type; } public function orderPay() { } public function refund($params) { return $this->success(); } public function orderDetail($order_info) { return []; } /** * 订单完成 * @param $params */ public function complete($params) { $site_id = $params[ 'site_id' ]; $order_id = $params[ 'order_id' ]; $cashier_order_model = new CashierOrder(); $cashier_data = array ( 'order_status' => 10, 'finish_time' => time(), 'order_status_name' => $cashier_order_model->order_status[ 10 ][ 'name' ], 'order_status_action' => json_encode($cashier_order_model->order_status[ 10 ], JSON_UNESCAPED_UNICODE) ); $cashier_condition = array ( [ 'order_id', '=', $order_id ], ); model('order')->update($cashier_data, $cashier_condition); //收银台的订单因部分不可抗力不能进行公共的订单完成事件,所以主动调用门店订单分成结算 if (addon_is_exit('store')) { ( new OrderSettlement() )->orderSettlementAccount([ 'order_id' => $order_id ]); } //模拟订单支付后操作钩子 if (addon_is_exit('memberconsume')) { $consume_model = new Consume(); $consume_model->memberConsume([ 'out_trade_no' => $params[ 'out_trade_no' ], 'status' => 'complete' ]); } $log_data = array ( 'order_id' => $order_id, 'action' => 'complete', 'site_id' => $site_id, 'is_auto' => 1 ); ( new OrderLog() )->addLog($log_data); return $this->success(); } }