|
|
@@ -21,6 +21,32 @@ class WorkController extends BaseController
|
|
|
|
|
|
public $guestAccess = [];
|
|
|
|
|
|
+ public function actionNeedWork()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有订单');
|
|
|
+ }
|
|
|
+ $mainId = $this->mainId;
|
|
|
+ if ($order->mainId != $mainId) {
|
|
|
+ util::fail('不是你的订单');
|
|
|
+ }
|
|
|
+ if ($order->hasWork == 1) {
|
|
|
+ util::fail('已经通知制作了');
|
|
|
+ }
|
|
|
+ $main = $this->main;
|
|
|
+ WorkClass::needWork($order, $main);
|
|
|
+ $has = WorkClass::getByCondition(['orderId' => $id], true);
|
|
|
+ if (!empty($has)) {
|
|
|
+ $order->hasWork = 1;
|
|
|
+ $order->save();
|
|
|
+ util::complete('通知成功');
|
|
|
+ }
|
|
|
+ util::fail('通知失败');
|
|
|
+ }
|
|
|
+
|
|
|
//根据订单id查询制作单信息 ssh 20220625
|
|
|
public function actionGetInfoByOrderId()
|
|
|
{
|