attributes = post_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); return $form->search(); } /** * 新-订单提交 * @return \yii\web\Response */ public function actionSubmit() { $form = new CostOrderSubmitForm(); $form->attributes = post_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); $form->user = get_user(); return $form->save(); } /** * 订单支付数据 * @return \yii\web\Response */ public function actionPayData() { $form = new CostOrderPayDataForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user = get_user(); return $form->search(); } /** * 订单列表 * @return \yii\web\Response */ public function actionList() { $form = new AdoptCostOrderListForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); return $form->search(); } /** * 订单取消 * @return \yii\web\Response */ public function actionRevoke() { $form = new CostOrderRevokeForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); return $form->save(); } /** * 订单详情 * @return \yii\web\Response */ public function actionDetail() { $form = new AdoptCostOrderDetailForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); if (!empty(get_params('userId'))) { $form->user_id = get_params('userId'); } else { $form->user_id = get_user_id(); } return $form->search(); } /** * 订单确认收货 */ public function actionConfirm() { $form = new CostOrderConfirmForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); return $form->save(); } /** * 订单物流信息 */ public function actionExpressDetail() { $form = new CostExpressDetailForm(); $form->attributes = get_params(); $form->store_id = get_store_id(); $form->user_id = get_user_id(); return $form->search(); } /** * @return \yii\web\Response */ public function actionUserDelete() { $order_id = post_params('order_id'); $order = Order::findOne(['id' => $order_id, 'user_delete' => 1]); if ($order) { return $this->asJson([ 'code' => 1, 'msg' => '订单已删除' ]); } Order::updateAll(['user_delete' => 1], ['id' => $order_id]); return $this->asJson([ 'code' => 0, 'msg' => '删除成功' ]); } public function actionFriendPay() { $order_id = post_params('order_id'); $order = Order::findOne(['id' => $order_id, 'is_delete' => 0]); \Yii::warning(['-------- 代付 -------', [$order_id, get_user_id()]]); if (get_user_id() != $order->user_id) { $order->pay_user_id = get_user_id(); $order->save(); } return $this->asJson([ 'code' => 0, 'msg' => 'success' ]); } }