|
|
@@ -187,7 +187,63 @@ class OrderController extends BaseController
|
|
|
util::success($result);
|
|
|
}
|
|
|
|
|
|
- //发货
|
|
|
+ //确认送达 ssh 20250902
|
|
|
+ public function actionReach()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有找到订单');
|
|
|
+ }
|
|
|
+ OrderClass::valid($order, $this->mainId);
|
|
|
+ if ($order->status == 5) {
|
|
|
+ util::fail('订单已取消');
|
|
|
+ }
|
|
|
+ if ($order->status == 1) {
|
|
|
+ util::fail('订单待付款');
|
|
|
+ }
|
|
|
+ if ($order->status == 2) {
|
|
|
+ util::fail('订单未发货');
|
|
|
+ }
|
|
|
+ if ($order->status == 4) {
|
|
|
+ util::fail('订单已经送到了');
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($order->sendStatus == 1 || $order->sendStatus == 2) {
|
|
|
+ util::fail('由跑腿送货,无需确认');
|
|
|
+ }
|
|
|
+
|
|
|
+ $order->status = 4;
|
|
|
+ $order->save();
|
|
|
+ util::complete('操作成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ //确认取货
|
|
|
+ public function actionFetch()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有找到订单');
|
|
|
+ }
|
|
|
+ OrderClass::valid($order, $this->mainId);
|
|
|
+ if ($order->status == 5) {
|
|
|
+ util::fail('订单已取消');
|
|
|
+ }
|
|
|
+ if ($order->status == 1) {
|
|
|
+ util::fail('订单待付款');
|
|
|
+ }
|
|
|
+ if ($order->status == 3 || $order->status == 4) {
|
|
|
+ util::fail('订单已取过了');
|
|
|
+ }
|
|
|
+ $order->status = 4;
|
|
|
+ $order->save();
|
|
|
+ util::complete('操作成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ //确认发货
|
|
|
public function actionSend()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
@@ -214,9 +270,9 @@ class OrderController extends BaseController
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
- $order->status = 4;
|
|
|
+ $order->status = 3;
|
|
|
$order->save();
|
|
|
- util::complete('操作成功');
|
|
|
+ util::complete('已发货');
|
|
|
}
|
|
|
|
|
|
//打印订单 ssh 20220601
|