product.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Route;
  12. use app\common\middleware\AdminAuthMiddleware;
  13. use app\common\middleware\AdminTokenMiddleware;
  14. use app\common\middleware\AllowOriginMiddleware;
  15. use app\common\middleware\LogMiddleware;
  16. Route::group(function () {
  17. //参数模板
  18. Route::group('store/params', function () {
  19. Route::get('temp/lst', '/lst')->name('systemStoreParameterTemplateLst')->option([
  20. '_alias' => '平台参数列表',
  21. ])->append(['is_mer' => 0]);
  22. Route::get('temp/merlst', '/lst')->name('systemStoreParameterTemplateMerLst')->option([
  23. '_alias' => '商户参数模板',
  24. '_path' => '/product/merSpecs',
  25. ])->append(['is_mer' => 1]);
  26. Route::get('temp/detail/:id', '/detail')->name('systemStoreParameterTemplateDetail')->option([
  27. '_alias' => '详情',
  28. ]);
  29. Route::delete('temp/delete/:id', '/delete')->name('systemStoreParameterTemplateDelete')->option([
  30. '_alias' => '删除',
  31. ]);
  32. Route::post('temp/create', '/create')->name('systemStoreParameterTemplateCreate')->option([
  33. '_alias' => '添加',
  34. ]);
  35. Route::post('temp/update/:id', '/update')->name('systemStoreParameterTemplateUpdate')->option([
  36. '_alias' => '编辑',
  37. ]);
  38. })->prefix('admin.parameter.ParameterTemplate')->option([
  39. '_path' => '/product/specs',
  40. '_auth' => true,
  41. ]);
  42. //商品分类
  43. Route::group('store/category', function () {
  44. Route::get('create/form', '/createForm')->name('systemStoreCategoryCreateForm')->option([
  45. '_alias' => '添加表单',
  46. '_auth' => false,
  47. '_form' => 'systemStoreCategoryCreate',
  48. ]);
  49. Route::get('update/form/:id', '/updateForm')->name('systemStoreCategoryUpdateForm')->option([
  50. '_alias' => '编辑表单',
  51. '_auth' => false,
  52. '_form' => 'systemStoreCategoryUpdate',
  53. ]);
  54. Route::post('update/:id', '/update')->name('systemStoreCategoryUpdate')->option([
  55. '_alias' => '编辑',
  56. ]);
  57. Route::get('lst', '/lst')->name('systemStoreCategoryLst')->option([
  58. '_alias' => '列表',
  59. ]);
  60. Route::get('detail/:id', '/detail')->name('systemStoreCategoryDtailt')->option([
  61. '_alias' => '详情',
  62. ]);
  63. Route::post('create', '/create')->name('systemStoreCategoryCreate')->option([
  64. '_alias' => '添加',
  65. ]);
  66. Route::delete('delete/:id', '/delete')->name('systemStoreCategoryDelete')->option([
  67. '_alias' => '删除',
  68. ]);
  69. Route::post('status/:id', '/switchStatus')->name('systemStoreCategorySwitchStatus')->option([
  70. '_alias' => '修改状态',
  71. ]);
  72. Route::post('is_hot/:id', '/switchIsHot')->name('systemStoreCategorySwitchIsHot')->option([
  73. '_alias' => '修改推荐',
  74. ]);
  75. Route::get('list', '/getList')->option([
  76. '_alias' => '筛选',
  77. '_auth' => false,
  78. ]);
  79. })->prefix('admin.store.StoreCategory')->option([
  80. '_path' => '/product/classify',
  81. '_auth' => true,
  82. '_append'=> [
  83. [
  84. '_name' =>'uploadImage',
  85. '_path' =>'/product/classify',
  86. '_alias' => '上传图片',
  87. '_auth' => true,
  88. ],
  89. [
  90. '_name' =>'systemAttachmentLst',
  91. '_path' =>'/product/classify',
  92. '_alias' => '图片列表',
  93. '_auth' => true,
  94. ],
  95. ]
  96. ]);
  97. //品牌分类
  98. Route::group('store/brand/category', function () {
  99. Route::get('create/form', '/createForm')->name('systemStoreBrandCategoryCreateForm')->option([
  100. '_alias' => '添加表单',
  101. '_auth' => false,
  102. '_form' => 'systemStoreBrandCategoryCreate',
  103. ]);
  104. Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandCategoryUpdateForm')->option([
  105. '_alias' => '编辑表单',
  106. '_auth' => false,
  107. '_form' => 'systemStoreBrandCategoryUpdate',
  108. ]);
  109. Route::post('update/:id', '/update')->name('systemStoreBrandCategoryUpdate')->option([
  110. '_alias' => '编辑',
  111. ]);
  112. Route::get('lst', '/lst')->name('systemStoreBrandCategoryLst')->option([
  113. '_alias' => '列表',
  114. ]);
  115. Route::get('detail/:id', '/detail')->name('systemStoreBrandCategoryDtailt')->option([
  116. '_alias' => '详情',
  117. ]);
  118. Route::post('create', '/create')->name('systemStoreBrandCategoryCreate')->option([
  119. '_alias' => '添加',
  120. ]);
  121. Route::delete('delete/:id', '/delete')->name('systemStoreBrandCategoryDelete')->option([
  122. '_alias' => '删除',
  123. ]);
  124. Route::post('status/:id', '/switchStatus')->name('systemStoreBrandCategorySwitchStatus')->option([
  125. '_alias' => '修改状态',
  126. ]);
  127. })->prefix('admin.store.StoreBrandCategory')->option([
  128. '_path' => '/product/band/brandClassify',
  129. '_auth' => true,
  130. ]);
  131. //品牌
  132. Route::group('store/brand', function () {
  133. Route::get('create/form', '/createForm')->name('systemStoreBrandCreateForm')->option([
  134. '_alias' => '添加表单',
  135. '_auth' => false,
  136. '_form' => 'systemStoreBrandCreate',
  137. ]);
  138. Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandUpdateForm')->option([
  139. '_alias' => '编辑表单',
  140. '_auth' => false,
  141. '_form' => 'systemStoreBrandUpdate',
  142. ]);
  143. Route::get('lst', '/lst')->name('systemStoreBrandLst')->option([
  144. '_alias' => '列表',
  145. ]);
  146. Route::post('status/:id', '/switchStatus')->name('systemStoreBrandSwithStatus')->option([
  147. '_alias' => '修改状态',
  148. ]);
  149. Route::post('create', '/create')->name('systemStoreBrandCreate')->option([
  150. '_alias' => '添加',
  151. ]);
  152. Route::post('update/:id', '/update')->name('systemStoreBrandUpdate')->option([
  153. '_alias' => '编辑',
  154. ]);
  155. Route::delete('delete/:id', '/delete')->name('systemStoreBrandDelete')->option([
  156. '_alias' => '删除',
  157. ]);
  158. })->prefix('admin.store.StoreBrand')->option([
  159. '_path' => '/product/band/brandList',
  160. '_auth' => true,
  161. ]);
  162. //商品
  163. Route::group('store/product', function () {
  164. Route::get('mer_select', '/lists')->option([
  165. '_alias' => '删除',
  166. '_auth' => false,
  167. ]);
  168. Route::get('lst_filter', '/getStatusFilter')->name('systemStoreProductLstFilter')->option([
  169. '_alias' => '统计',
  170. ]);
  171. Route::get('lst', '/lst')->name('systemStoreProductLst')->option([
  172. '_alias' => '列表',
  173. ]);
  174. Route::get('list', '/lst')->option([
  175. '_alias' => '',
  176. '_auth' => false,
  177. ]);
  178. Route::get('detail/:id', '/detail')->name('systemStoreProductDetail')->option([
  179. '_alias' => '详情',
  180. ]);
  181. Route::post('update/:id', '/update')->name('systemStoreProductUpdate')->option([
  182. '_alias' => '编辑',
  183. ]);
  184. Route::post('status', '/switchStatus')->name('systemStoreProductSwitchStatus')->option([
  185. '_alias' => '上下架',
  186. ]);
  187. Route::post('batch_status', '/batchShow')->name('systemStoreProductSwitchBatchStatus')->option([
  188. '_alias' => '批量上下架',
  189. ]);
  190. Route::post('batch_labels', '/batchLabels')->name('systemStoreProductSwitchBatchLabels')->option([
  191. '_alias' => '批量设置标签',
  192. ]);
  193. Route::post('batch_hot', '/batchHot')->name('systemStoreProductSwitchBatchHot')->option([
  194. '_alias' => '批量设置推荐',
  195. ]);
  196. Route::post('check', '/checkProduct')->name('systemStoreProductCheck')->option([
  197. '_alias' => '分销状态变更商品检测',
  198. ]);
  199. Route::post('change/:id', '/changeUsed')->name('systemStoreProductChangeUsed')->option([
  200. '_alias' => '显示/隐藏',
  201. ]);
  202. Route::get('ficti/form/:id', '/addFictiForm')->name('systemStoreProductAddFictiForm')->option([
  203. '_alias' => '虚拟销量表单',
  204. '_auth' => false,
  205. '_form' => 'systemStoreProductAddFicti',
  206. ]);
  207. Route::post('ficti/:id', '/addFicti')->name('systemStoreProductAddFicti')->option([
  208. '_alias' => '虚拟销量',
  209. ]);
  210. Route::post('labels/:id', '/setLabels')->name('systemStoreProductLabels')->option([
  211. '_alias' => '设置标签',
  212. ]);
  213. })->prefix('admin.store.StoreProduct')->option([
  214. '_path' => '/product/examine',
  215. '_auth' => true,
  216. ]);
  217. //商品评价管理
  218. Route::group('store/reply', function () {
  219. Route::get('lst', '/lst')->name('systemProductReplyLst')->option([
  220. '_alias' => '列表',
  221. ]);
  222. Route::get('create/form/:id?', '/virtualForm')->name('systemProductReplyCreateForm')->option([
  223. '_alias' => '添加虚拟评论表单',
  224. '_auth' => false,
  225. '_form' => 'systemProductReplyCreate',
  226. ]);
  227. Route::post('create', '/virtualReply')->name('systemProductReplyCreate')->option([
  228. '_alias' => '添加虚拟评论',
  229. ]);
  230. Route::post('sort/:id', '/sort')->name('systemProductReplySort')->option([
  231. '_alias' => '排序',
  232. ]);
  233. Route::delete('delete/:id', '/delete')->name('systemProductReplyDelete')->option([
  234. '_alias' => '删除',
  235. ]);
  236. })->prefix('admin.store.StoreProductReply')->option([
  237. '_path' => '/product/comment',
  238. '_auth' => true,
  239. '_append'=> [
  240. [
  241. '_name' =>'uploadImage',
  242. '_path' =>'/product/comment',
  243. '_alias' => '上传图片',
  244. '_auth' => true,
  245. ],
  246. [
  247. '_name' =>'systemAttachmentLst',
  248. '_path' =>'/product/comment',
  249. '_alias' => '图片列表',
  250. '_auth' => true,
  251. ],
  252. ]
  253. ]);
  254. //保障服务
  255. Route::group('guarantee', function () {
  256. Route::get('lst', '/lst')->name('systemGuaranteeLst')->option([
  257. '_alias' => '列表',
  258. ]);
  259. Route::get('create/form', '/createForm')->name('systemGuaranteeCreateForm')->option([
  260. '_alias' => '添加表单',
  261. '_auth' => false,
  262. '_form' => 'systemGuaranteeCreate',
  263. ]);
  264. Route::post('create', '/create')->name('systemGuaranteeCreate')->option([
  265. '_alias' => '添加',
  266. ]);
  267. Route::get('update/:id/form', '/updateForm')->name('systemGuaranteeUpdateForm')->option([
  268. '_alias' => '编辑表单',
  269. '_auth' => false,
  270. '_form' => 'systemGuaranteeUpdate',
  271. ]);
  272. Route::post('update/:id', '/update')->name('systemGuaranteeUpdate')->option([
  273. '_alias' => '编辑',
  274. ]);
  275. Route::get('detail/:id', '/detail')->name('systemGuaranteeDetail')->option([
  276. '_alias' => '详情',
  277. ]);
  278. Route::delete('delete/:id', '/delete')->name('systemGuaranteeDelete')->option([
  279. '_alias' => '删除',
  280. ]);
  281. Route::post('sort/:id', '/sort')->name('systemGuaranteeSort')->option([
  282. '_alias' => '排序',
  283. ]);
  284. Route::post('status/:id', '/switchStatus')->name('systemGuaranteeStatus')->option([
  285. '_alias' => '修改状态',
  286. ]);
  287. })->prefix('admin.store.Guarantee')->option([
  288. '_path' => '/product/guarantee',
  289. '_auth' => true,
  290. '_append'=> [
  291. [
  292. '_name' =>'uploadImage',
  293. '_path' =>'/product/guarantee',
  294. '_alias' => '上传图片',
  295. '_auth' => true,
  296. ],
  297. [
  298. '_name' =>'systemAttachmentLst',
  299. '_path' =>'/product/guarantee',
  300. '_alias' => '图片列表',
  301. '_auth' => true,
  302. ],
  303. ]
  304. ]);
  305. //商品标签
  306. Route::group('product/label', function () {
  307. Route::get('lst', '/lst')->name('systemStoreProductLabelLst')->option([
  308. '_alias' => '列表',
  309. ]);
  310. Route::get('create/form', '/createForm')->name('systemStoreProductLabelCreateForm')->option([
  311. '_alias' => '添加表单',
  312. '_auth' => false,
  313. '_form' => 'systemStoreProductLabelCreate',
  314. ]);
  315. Route::post('create', '/create')->name('systemStoreProductLabelCreate')->option([
  316. '_alias' => '添加',
  317. ]);
  318. Route::get('update/:id/form', '/updateForm')->name('systemStoreProductLabelUpdateForm')->option([
  319. '_alias' => '编辑表单',
  320. '_auth' => false,
  321. '_form' => 'systemStoreProductLabelUpdate',
  322. ]);
  323. Route::post('update/:id', '/update')->name('systemStoreProductLabelUpdate')->option([
  324. '_alias' => '编辑',
  325. ]);
  326. Route::get('detail/:id', '/detail')->name('systemStoreProductLabelDetail')->option([
  327. '_alias' => '详情',
  328. ]);
  329. Route::delete('delete/:id', '/delete')->name('systemStoreProductLabelDelete')->option([
  330. '_alias' => '删除',
  331. ]);
  332. Route::post('status/:id', '/switchWithStatus')->name('systemStoreProductLabelStatus')->option([
  333. '_alias' => '修改状态',
  334. ]);
  335. Route::get('option', '/getOptions')->option([
  336. '_alias' => '筛选',
  337. '_auth' => false,
  338. ]);
  339. })->prefix('admin.store.ProductLabel')->option([
  340. '_path' => '/product/label',
  341. '_auth' => true,
  342. ]);
  343. Route::group('discounts/', function () {
  344. Route::get('lst', '/lst')->name('systemStoreDiscountsLst')->option([
  345. '_alias' => '优惠套餐列表',
  346. ]);
  347. Route::get('detail/:id', '/detail')->name('systemStoreDiscountsDetail')->option([
  348. '_alias' => '优惠套餐详情',
  349. ]);
  350. Route::post('status/:id', '/switchStatus')->name('systemStoreDiscountsStatus')->option([
  351. '_alias' => '优惠套餐修改状态',
  352. ]);
  353. })->prefix('admin.store.Discounts')->option([
  354. '_path' => '/marketing/discounts/list',
  355. '_auth' => true,
  356. '_append'=> [
  357. [
  358. '_name' =>'uploadImage',
  359. '_path' =>'/marketing/discounts/list',
  360. '_alias' => '上传图片',
  361. '_auth' => true,
  362. ],
  363. [
  364. '_name' =>'systemAttachmentLst',
  365. '_path' =>'/marketing/discounts/list',
  366. '_alias' => '图片列表',
  367. '_auth' => true,
  368. ],
  369. ]
  370. ]);
  371. Route::group('price_rule/', function () {
  372. Route::get('lst', '/lst')->name('systemPriceRuleLst')->option([
  373. '_alias' => '价格说明列表',
  374. ]);
  375. Route::post('create', '/create')->name('systemPriceRuleCreate')->option([
  376. '_alias' => '添加价格说明',
  377. ]);
  378. Route::post('update/:id', '/update')->name('systemPriceRuleUpdate')->option([
  379. '_alias' => '修改价格说明',
  380. ]);
  381. Route::post('status/:id', '/switchStatus')->name('systemPriceRuleStatus')->option([
  382. '_alias' => '价格说明修改状态',
  383. ]);
  384. Route::delete('del/:id', '/delete')->name('systemPriceRuleDelete')->option([
  385. '_alias' => '删除价格说明',
  386. ]);
  387. })->prefix('admin.store.PriceRule')->option([
  388. '_path' => '/product/priceDescription',
  389. '_auth' => true,
  390. '_append' => [
  391. [
  392. '_name' => 'uploadImage',
  393. '_path' => '/product/priceDescription',
  394. '_alias' => '上传图片',
  395. '_auth' => true,
  396. ],
  397. [
  398. '_name' => 'systemAttachmentLst',
  399. '_path' => '/product/priceDescription',
  400. '_alias' => '图片列表',
  401. '_auth' => true,
  402. ],
  403. ]
  404. ]);
  405. })->middleware(AllowOriginMiddleware::class)
  406. ->middleware(AdminTokenMiddleware::class, true)
  407. ->middleware(AdminAuthMiddleware::class)
  408. ->middleware(LogMiddleware::class);