ShopController.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\controllers;
  8. use app\models\District;
  9. use app\modules\admin\models\CardForm;
  10. use app\modules\admin\models\CashForm;
  11. use app\modules\admin\models\ShopForm;
  12. use app\modules\admin\models\ClerkForm;
  13. use app\modules\admin\models\ShopSettingForm;
  14. /**
  15. * Undocumented class
  16. *
  17. * @Author LGL 24963@qq.com
  18. * @DateTime 2021-01-13
  19. * @desc: 自提点管理
  20. */
  21. class ShopController extends BaseController
  22. {
  23. /**
  24. * Undocumented function
  25. *
  26. * @Author LGL 24963@qq.com
  27. * @DateTime 2021-01-13
  28. * @desc: 自提点列表
  29. * @return void
  30. */
  31. public function actionShopList()
  32. {
  33. $param = get_params();
  34. $form = new ShopForm();
  35. $form->scenario = $form::SCENARIO_LIST;
  36. $form->attributes = $param;
  37. return $this->asJson($form->searchShop());
  38. }
  39. /**
  40. * Undocumented function
  41. *
  42. * @Author LGL 24963@qq.com
  43. * @DateTime 2021-01-13
  44. * @desc: 商户添加
  45. */
  46. public function actionShopAdd()
  47. {
  48. $param = post_params();
  49. $form = new ShopForm();
  50. $form->scenario = $form::SCENARIO_ADD;
  51. $form->attributes = $param;
  52. $form->store_id = get_store_id();
  53. if ($param['begin_time']) {
  54. $form->begin_time = strtotime($param['begin_time']);
  55. }
  56. if ($param['end_time']) {
  57. $form->end_time = strtotime($param['end_time']);
  58. }
  59. $res = $form->saveShop();
  60. return $this->asJson($res);
  61. }
  62. /**
  63. * Undocumented function
  64. *
  65. * @Author LGL 24963@qq.com
  66. * @DateTime 2021-01-13
  67. * @desc: 自提点编辑
  68. */
  69. public function actionShopEdit()
  70. {
  71. $param = post_params();
  72. $form = new ShopForm();
  73. $form->scenario = $form::SCENARIO_EDIT;
  74. $form->attributes = $param;
  75. $form->store_id = get_store_id();
  76. if ($param['begin_time']) {
  77. $form->begin_time = strtotime($param['begin_time']);
  78. }
  79. if ($param['end_time']) {
  80. $form->end_time = strtotime($param['end_time']);
  81. }
  82. $res = $form->saveShop();
  83. return $this->asJson($res);
  84. }
  85. /**
  86. * Undocumented function
  87. *
  88. * @Author LGL 24963@qq.com
  89. * @DateTime 2021-01-13
  90. * @desc: 自提点删除
  91. * @return void
  92. */
  93. public function actionShopDel()
  94. {
  95. //主键id用key标识并进行获取
  96. $param = get_params('key');
  97. $form = new ShopForm();
  98. $form->scenario = $form::SCENARIO_DEL;
  99. $form->id = $param;
  100. $res = $form->delShop();
  101. return $this->asJson($res);
  102. }
  103. /**
  104. * Undocumented function
  105. *
  106. * @Author LGL 24963@qq.com
  107. * @DateTime 2021-01-14
  108. * @desc: 自提点审核
  109. * @return void
  110. */
  111. public function actionShopAudit()
  112. {
  113. $param = post_params();
  114. $form = new ShopForm();
  115. $form->scenario = $form::SCENARIO_AUDIT;
  116. $form->attributes = $param;
  117. $res = $form->auditShop();
  118. return $this->asJson($res);
  119. }
  120. /**
  121. * Undocumented function
  122. *
  123. * @Author LGL 24963@qq.com
  124. * @DateTime 2021-01-14
  125. * @desc: 核销员提现管理
  126. * @return void
  127. */
  128. public function actionShopCashList()
  129. {
  130. $param = get_params();
  131. $form = new CashForm();
  132. $form->scenario = $form::SCENARIO_LIST;
  133. $form->attributes = $param;
  134. return $this->asJson($form->searchShopCash());
  135. }
  136. /**
  137. * Undocumented function
  138. *
  139. * @Author LGL 24963@qq.com
  140. * @DateTime 2021-01-15
  141. * @desc: 核销员列表
  142. * @return void
  143. */
  144. public function actionClerkList()
  145. {
  146. $param = get_params();
  147. $form = new ClerkForm();
  148. $form->scenario = $form::SCENARIO_LIST;
  149. $form->attributes = $param;
  150. return $this->asJson($form->searchClerk());
  151. }
  152. /**
  153. * Undocumented function
  154. *
  155. * @Author LGL 24963@qq.com
  156. * @DateTime 2021-01-13
  157. * @desc: 商户添加
  158. * @return void
  159. */
  160. public function actionClerkAdd()
  161. {
  162. $param = post_params();
  163. $form = new ClerkForm();
  164. $form->scenario = $form::SCENARIO_ADD;
  165. $form->attributes = $param;
  166. $form->store_id = get_store_id();
  167. $res = $form->saveClerk();
  168. return $this->asJson($res);
  169. }
  170. /**
  171. * Undocumented function
  172. *
  173. * @Author LGL 24963@qq.com
  174. * @DateTime 2021-01-13
  175. * @desc: 自提点编辑
  176. * @return void
  177. */
  178. public function actionClerkEdit()
  179. {
  180. $param = post_params();
  181. $form = new ClerkForm();
  182. $form->scenario = $form::SCENARIO_EDIT;
  183. $form->attributes = $param;
  184. $form->store_id = get_store_id();
  185. $res = $form->saveClerk();
  186. return $this->asJson($res);
  187. }
  188. /**
  189. * Undocumented function
  190. *
  191. * @Author LGL 24963@qq.com
  192. * @DateTime 2021-01-13
  193. * @desc: 自提点删除
  194. * @return void
  195. */
  196. public function actionClerkDel()
  197. {
  198. //主键id用key标识并进行获取
  199. $param = get_params('key');
  200. $form = new ClerkForm();
  201. $form->scenario = $form::SCENARIO_DEL;
  202. $form->id = $param;
  203. $res = $form->delClerk();
  204. return $this->asJson($res);
  205. }
  206. /**
  207. * Undocumented function
  208. *
  209. * @Author LGL 24963@qq.com
  210. * @DateTime 2021-01-15
  211. * @desc: 自提点设置
  212. * @return void
  213. */
  214. public function actionShopSettingList()
  215. {
  216. $param = get_params();
  217. $form = new ShopSettingForm();
  218. $form->scenario = $form::SCENARIO_LIST;
  219. $form->attributes = $param;
  220. return $this->asJson([
  221. 'code' => 0,
  222. 'data' => $form->getShopSettingList()
  223. ]);
  224. }
  225. /**
  226. * Undocumented function
  227. *
  228. * @Author LGL 24963@qq.com
  229. * @DateTime 2021-03-18
  230. * @desc: 自提点设置保存
  231. * @return void
  232. */
  233. public function actionShopSettingEdit()
  234. {
  235. $param = post_params();
  236. $form = new ShopSettingForm();
  237. $form->scenario = $form::SCENARIO_EDIT;
  238. $form->attributes = $param;
  239. $res = $form->saveShopSetting();
  240. return $this->asJson($res);
  241. }
  242. }