NoticeController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace addons\QiJuhe\backend\controllers;
  3. use addons\QiJuhe\common\models\NoticeModel;
  4. use addons\QiJuhe\common\service\NoticeService;
  5. use addons\QiJuhe\common\service\OrderService;
  6. use addons\QiJuhe\common\service\QiGoodsService;
  7. /**
  8. * 消息通知
  9. */
  10. class NoticeController extends BaseController
  11. {
  12. public $enableCsrfValidation = false;
  13. /**
  14. * 列表
  15. *
  16. * @return string
  17. */
  18. public function actionIndex()
  19. {
  20. if (!$this->request->isAjax) {
  21. return $this->render('index');
  22. }
  23. $param = $this->request->get();
  24. $service = new NoticeService(['mall_id'=>$this->mall_id]);
  25. return $this->success('ok', $service->list($param));
  26. }
  27. /**
  28. * 类型
  29. *
  30. * @return void
  31. */
  32. public function actionType()
  33. {
  34. if ($this->request->isAjax) {
  35. return $this->success('ok', NoticeModel::$type_text);
  36. }
  37. }
  38. public function actionTest()
  39. {
  40. $service = new OrderService(['mall_id' => $this->mall_id]);
  41. $service->createOrder(7188);
  42. // QiGoodsService::add([710], $this->mall_id);
  43. }
  44. }