| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace hd\controllers;
- use bizHd\work\classes\WorkClass;
- use common\components\orderSn;
- use common\components\util;
- use Yii;
- class WorkController extends BaseController
- {
- public $guestAccess = [];
- //工单列表 shish 20220319
- public function actionList()
- {
- $get = Yii::$app->request->get();
- $where = [];
- $where['mainId'] = $this->mainId;
- if (isset($get['status']) && is_numeric($get['status'])) {
- $status = $get['status'];
- $where['status'] = $status;
- }
- $list = WorkClass::getWorkList($where);
- util::success(['list' => $list]);
- }
- //新建工单 shish 20220319
- public function actionCreate()
- {
- $post = Yii::$app->request->post();
- $post['mainId'] = $this->mainId ?? 0;
- $post['sjId'] = $this->sjId ?? 0;
- $post['shopId'] = $this->shopId ?? 0;
- $orderSn = orderSn::getWorkSn();
- $post['orderSn'] = $orderSn;
- $work = WorkClass::add($post, true);
- util::success(['info' => $work]);
- }
- }
|