request->get(); $orderStatus = isset($get['status']) ? $get['status'] : ''; $where = []; $where['inShopId'] = $this->shopId; if (!empty($orderStatus)) { $where['status'] = $orderStatus; } $list = StockInOrderClass::getOrderList($where); util::success($list); } //入库详情 lqh 2021.1.25 public function actionDetail() { $orderSn = Yii::$app->request->get('orderSn', ''); $orderData = StockInOrderClass::getOrderDetail($orderSn, $this->shopId); util::success($orderData); } //确认入库 lqh 2021.1.24 public function actionConfirmOrder() { $get = Yii::$app->request->get(); $orderSn = $get['orderSn']; $connection = Yii::$app->db; $transaction = $connection->beginTransaction(); try { StockInOrderClass::confirmOrder($orderSn, $this->shopId, $this->adminId); $transaction->commit(); util::complete("入库成功"); } catch (\Exception $exception) { Yii::info("确认入库报错:" . $exception->getMessage()); $transaction->rollBack(); util::fail(); } } //取消入库 lqh 2021.1.24 public function actionCancelOrder() { $get = Yii::$app->request->get(); $orderSn = $get['orderSn'] ?? ''; $order = StockInOrderClass::getByCondition(['orderSn' => $orderSn], true); if (empty($order)) { util::fail('订单不存在'); } if (isset($order->inShopId) == false || $order->inShopId != $this->shopId) { util::fail('没有权限'); } $id = $order->id ?? 0; $info = StockInOrderClass::getLockById($id); StockInOrderClass::cancelOrder($info, $this->adminId); util::complete("取消成功"); } }