store_id = get_store_id(); $form->md_id = $this->md_id; $form->scenario = $form::IMMEDIATELY_PAY; $form->attributes = get_params(); return $this->asJson($form->getPayQrcode()); } /** * 操作挂单 * @return \yii\web\Response * @author: hankaige * @Time: 2024/12/5 上午9:15 */ public function actionHangingOrder():\yii\web\Response { $form = new OrderForm(); $form->store_id = get_store_id(); $form->scenario = $form::HANGING_ORDER; $form->attributes = post_params(); return $this->asJson($form->hangingOrder()); } /** * 获取挂单列表 * @return \yii\web\Response * @author: hankaige * @Time: 2024/12/5 上午10:53 */ public function actionGetHangingOrderList():\yii\web\Response { $form = new OrderForm(); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->scenario = $form::HANGING_ORDER_LIST; $form->attributes = get_params(); return $this->asJson($form->getHangingOrderList()); } public function actionGetHangingOrderDetail():\yii\web\Response { $form = new OrderForm(); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->scenario = $form::HANGING_ORDER_DETAIL; $form->attributes = get_params(); return $this->asJson($form->getHangingOrderDetail()); } /** * 删除挂单订单 * @return \yii\web\Response * User: hankaige * DATE TIME: 2022/12/6 09:36 */ public function actionDelHangingOrder(){ $form = new OrderForm(); $form->store_id = get_store_id(); $form->scenario = $form::DEL_HANGING_ORDER; $form->attributes = get_params(); return $this->asJson($form->delHanging()); } /** * 取出挂单信息 * @return \yii\web\Response * @author: hankaige * @Time: 2024/12/5 上午11:36 */ public function actionGetHangingOrder():\yii\web\Response { $form = new OrderForm(); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->scenario = $form::GET_HANGING_ORDER; $form->attributes = get_params(); return $this->asJson($form->getHangingOrder()); } public function actionOrderPreview():\yii\web\Response { $form = new MchOrderSubmitPreviewForm(); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->attributes = post_params(); return $this->asJson($form->search()); } // todo 生成待支付订单 public function actionOrderSubmit(){ $form = new MchOrderSubmitForm(); $params = post_params(); $params['hangind_order_id'] = empty($params['hangind_order_id']) || $params['hangind_order_id'] == 'null' ? 0 : $params['hangind_order_id']; $form->attributes = $params; $form->user_id = post_params('user_id'); $form->store_id = get_store_id(); $form->md_id = $this->md_id; return $this->asJson($form->save()); } // todo 支付订单 public function actionPayData(){ $form = new MchOrderPayDataForm(); $form->attributes = post_params(); $form->user_id = post_params('user_id'); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->_from = 'cashier'; return $this->asJson($form->search()); } public function actionOrderList():\yii\web\Response { $form = new OrderForm(); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->scenario = $form::ORDER_LIST; $form->attributes = get_params(); return $this->asJson($form->orderList()); } public function actionRefundOrder():\yii\web\Response { // 获取订单 $store_id = get_store_id(); $form = new OrderListForm(); $form->attributes = get_params(); $form->is_offline = Order::IS_OFFLINE_FALSE; $form->store_id = $store_id; $form->order_id = get_params('order_id'); return $this->asJson($form->orderRefund()); } public function actionPrintOrder(){ $data = post_params(); $type = $data['type'] ?? 0; $store_id = get_store_id(); $md_id = $this->md_id; $mch_id = get_mch_id(); if ((int)$md_id === -1 || (int)$md_id === 0) { $md_id = 0; } // 订单打印 $print = new PrintOrder($store_id, $data['order_id'], 'reprint', $data['order_type'], $md_id ?: 0, $type, $mch_id); return $this->asJson($print->print_order()); } public function actionGetReuseGoodsPrice(){ $form = new ReuseOrderGoodsPriceForm(); $form->user_id = post_params('user_id'); $form->goods_id = post_params('goods_id'); $form->store_id = get_store_id(); return $this->asJson($form->search()); } }