product.php 18 KB

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