WorkController.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace hd\controllers;
  3. use bizHd\work\classes\WorkClass;
  4. use common\components\orderSn;
  5. use common\components\util;
  6. use Yii;
  7. class WorkController extends BaseController
  8. {
  9. public $guestAccess = [];
  10. //工单列表 shish 20220319
  11. public function actionList()
  12. {
  13. $get = Yii::$app->request->get();
  14. $where = [];
  15. $where['mainId'] = $this->mainId;
  16. if (isset($get['status']) && is_numeric($get['status'])) {
  17. $status = $get['status'];
  18. $where['status'] = $status;
  19. }
  20. $list = WorkClass::getWorkList($where);
  21. util::success(['list' => $list]);
  22. }
  23. //新建工单 shish 20220319
  24. public function actionCreate()
  25. {
  26. $post = Yii::$app->request->post();
  27. $post['mainId'] = $this->mainId ?? 0;
  28. $post['sjId'] = $this->sjId ?? 0;
  29. $post['shopId'] = $this->shopId ?? 0;
  30. $orderSn = orderSn::getWorkSn();
  31. $post['orderSn'] = $orderSn;
  32. $work = WorkClass::add($post, true);
  33. util::success(['info' => $work]);
  34. }
  35. }