SetMealController.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace ghs\controllers;
  3. use bizHd\saas\services\SetMealService;
  4. use Yii;
  5. use common\components\util;
  6. class SetMealController extends BaseController
  7. {
  8. public $guestAccess = ['get-detail'];
  9. //套餐列表 ssh 2019.12.8
  10. public function actionList()
  11. {
  12. $fest = SetMealService::getAllByCondition([], null, '*');
  13. util::success($fest);
  14. }
  15. //添加套餐 ssh 2019.12.21
  16. public function actionAdd()
  17. {
  18. $post = Yii::$app->request->post();
  19. $return = SetMealService::add($post);
  20. util::success($return);
  21. }
  22. //修改套餐 ssh 2019.12.21
  23. public function actionUpdate()
  24. {
  25. $post = Yii::$app->request->post();
  26. $id = $post['id'];
  27. unset($post['id']);
  28. SetMealService::updateById($id, $post);
  29. util::complete();
  30. }
  31. //套餐详情 ssh 2019.12.21
  32. public function actionDetail()
  33. {
  34. $id = Yii::$app->request->get('id');
  35. $fest = SetMealService::getById($id);
  36. util::success($fest);
  37. }
  38. //花店老板查看套餐详情 ssh 2020.1.11
  39. public function actionGetDetail()
  40. {
  41. $id = Yii::$app->request->get('id', 1);
  42. $detail = SetMealService::getSetById($id);
  43. $detail['introduce'] = '可以满足日常的经营、管理和营销需求。';
  44. $function = [
  45. ['name' => '线上商城', 'has' => 1],
  46. ['name' => '销售开单', 'has' => 1],
  47. ['name' => '智能改价', 'has' => 1],
  48. ['name' => '采购入库', 'has' => 1],
  49. ['name' => '欠款管理', 'has' => 1],
  50. ['name' => '门店管理', 'has' => 1],
  51. ['name' => '花材功能', 'has' => 1],
  52. ['name' => '库存管理', 'has' => 1],
  53. ['name' => '调拨出库', 'has' => 1],
  54. ['name' => '调拨入库', 'has' => 1],
  55. ['name' => '员工管理', 'has' => 1],
  56. ['name' => '订单管理', 'has' => 1],
  57. ['name' => '发货管理', 'has' => 1],
  58. ['name' => '客户管理', 'has' => 1],
  59. ];
  60. $free = rand(0, 1);
  61. $data = ['detail' => $detail, 'function' => $function, 'free' => $free];
  62. util::success($data);
  63. }
  64. }