PickLink.php 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. /*
  8. * @Author: your name
  9. * @Date: 2021-03-02 09:50:20
  10. * @LastEditTime: 2021-05-21 11:56:14
  11. * @LastEditors: Please set LastEditors
  12. * @Description: In User Settings Edit
  13. * @FilePath: \admin_php\constants\PickLink.php
  14. */
  15. namespace app\constants;
  16. use app\models\NewDiyTemplate;
  17. use app\models\Option;
  18. use app\models\SaasCategory;
  19. use app\models\Store;
  20. use yii\helpers\Json;
  21. class PickLink
  22. {
  23. const LIST = [
  24. [
  25. 'name' => '平台首页',
  26. 'link' => '/pages/home/home',
  27. 'open_type' => "switchtab",
  28. 'params' => []
  29. ],
  30. [
  31. 'name' => '购物车',
  32. 'link' => '/pages/shoppingcart/shoppingcart',
  33. 'open_type' => "switchtab",
  34. 'params' => []
  35. ],
  36. [
  37. 'name' => '联盟会员卡',
  38. 'link' => '/user/member/saas_member',
  39. 'open_type' => "navigate",
  40. 'params' => []
  41. ],
  42. [
  43. 'name' => '领券中心',
  44. 'link' => '/other/coupon_center/coupon_center',
  45. 'open_type' => "navigate",
  46. 'params' => []
  47. ],
  48. // [
  49. // 'name' => '联盟佣金',
  50. // 'link' => '/pages/union/user-account',
  51. // 'open_type' => "navigate",
  52. // 'params' => []
  53. // ],
  54. [
  55. 'name' => '足迹',
  56. 'link' => '/user/history/history',
  57. 'open_type' => "navigate",
  58. 'params' => []
  59. ],
  60. [
  61. 'name' => '收货地址管理',
  62. 'link' => '/user/my/addressmanage',
  63. 'open_type' => "navigate",
  64. 'params' => []
  65. ],
  66. [
  67. 'name' => '店铺列表',
  68. 'link' => '/union/class-search/index',
  69. 'open_type' => "navigate",
  70. 'params' => [
  71. [
  72. 'key' => "common_cat_id",
  73. 'value' => "",
  74. 'desc' => "商城分类ID",
  75. 'type' => "select",
  76. 'options' => [],
  77. 'label_name' => "商城分类"
  78. ],
  79. [
  80. 'key' => "cat_name",
  81. 'value' => "",
  82. 'label_name' => "商城分类名称",
  83. 'hidden' => true
  84. ],
  85. ]
  86. ],
  87. [
  88. 'name' => '用户中心',
  89. 'link' => '/pages/my/my',
  90. 'open_type' => "switchtab",
  91. 'params' => []
  92. ],
  93. [
  94. 'name' => "所有订单",
  95. 'link' => "/order/order/order",
  96. 'open_type' => "navigate",
  97. 'params' => []
  98. ],
  99. [
  100. 'name' => "待付款订单",
  101. 'link' => "/order/order/order?status=0",
  102. 'open_type' => "navigate",
  103. 'params' => []
  104. ],
  105. [
  106. 'name' => "待发货订单",
  107. 'link' => "/order/order/order?status=1",
  108. 'open_type' => "navigate",
  109. 'params' => []
  110. ],
  111. [
  112. 'name' => "待收货订单",
  113. 'link' => "/order/order/order?status=2",
  114. 'open_type' => "navigate",
  115. 'params' => []
  116. ],
  117. [
  118. 'name' => "已完成订单",
  119. 'link' => "/order/order/order?status=3",
  120. 'open_type' => "navigate",
  121. 'params' => []
  122. ],
  123. [
  124. 'name' => '一键拨号',
  125. 'link' => 'tel',
  126. 'open_type' => 'tel',
  127. 'params' => [
  128. [
  129. 'key' => "tel",
  130. 'value' => "",
  131. 'desc' => "请填写联系电话"
  132. ]
  133. ],
  134. ],
  135. [
  136. 'name' => '小程序',
  137. 'link' => 'wxapp',
  138. 'open_type' => 'wxapp',
  139. 'params' => [
  140. [
  141. 'key' => "appid",
  142. 'value' => "",
  143. 'desc' => "请填写小程序appid"
  144. ],
  145. [
  146. 'key' => "path",
  147. 'value' => "",
  148. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  149. ],
  150. ],
  151. ],
  152. [
  153. 'name' => '客服',
  154. 'link' => 'contact',
  155. 'open_type' => 'contact',
  156. 'params' => []
  157. ],
  158. [
  159. 'name' => '业务员',
  160. 'link' => 'wxapp',
  161. 'open_type' => 'wxapp',
  162. 'is_merchant' => 1,
  163. 'params' => [
  164. [
  165. 'key' => "appid",
  166. 'value' => "",
  167. 'desc' => "请填写小程序appid"
  168. ],
  169. [
  170. 'key' => "path",
  171. 'value' => "type=0&param=yewuyuan",
  172. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  173. ],
  174. ],
  175. ],
  176. // [
  177. // 'name' => '申请店铺',
  178. // 'link' => '/salesman/salesman/applyShop',
  179. // 'open_type' => 'navigate',
  180. // 'params' => [],
  181. // ],
  182. // [
  183. // 'name' => '代理中心',
  184. // 'link' => '/salesman/salesman/agencyCenter',
  185. // 'open_type' => 'navigate',
  186. // 'params' => [],
  187. // ],
  188. // [
  189. // 'name' => '商城后台',
  190. // 'link' => '/admin/home/home',
  191. // 'open_type' => 'navigate',
  192. // 'params' => [],
  193. // ],
  194. [
  195. 'name' => '我的卡券',
  196. 'link' => '/user/write_off_card/write_off_card',
  197. 'open_type' => 'navigate',
  198. 'params' => [],
  199. ],
  200. [
  201. 'name' => '跳转店铺',
  202. 'link' => 'store',
  203. 'open_type' => 'store',
  204. 'params' => [
  205. [
  206. 'key' => "store_id",
  207. 'value' => "",
  208. 'desc' => "跳转店铺首页",
  209. 'type' => "select",
  210. 'options' => [],
  211. 'label_name' => "选择店铺"
  212. ],
  213. ],
  214. ],
  215. [
  216. 'name' => "我的积分",
  217. 'link' => "/face-pay/face-pay/storePoints",
  218. 'open_type' => "navigate",
  219. 'params' => []
  220. ],
  221. // [
  222. // 'name' => "分销中心",
  223. // 'link' => "/user/share/index",
  224. // 'open_type' => "navigate",
  225. // 'params' => []
  226. // ],
  227. // [
  228. // 'name' => "佣金统计",
  229. // 'link' => "/user/brokerageCharges/index",
  230. // 'open_type' => "navigate",
  231. // 'params' => []
  232. // ],
  233. // [
  234. // 'name' => "消费返利",
  235. // 'link' => "/user/rebate/index",
  236. // 'open_type' => "navigate",
  237. // 'params' => []
  238. // ],
  239. [
  240. 'name' => '分账账户',
  241. 'link' => '/user/share/share-account',
  242. 'open_type' => 'navigate',
  243. 'params' => [],
  244. ],
  245. [
  246. 'name' => '服务端小程序',
  247. 'link' => 'wxapp',
  248. 'open_type' => 'wxapp',
  249. 'is_merchant' => 1,
  250. 'params' => [
  251. [
  252. 'key' => "appid",
  253. 'value' => "",
  254. 'desc' => "请填写小程序appid"
  255. ],
  256. [
  257. 'key' => "path",
  258. 'value' => "pages/index/index",
  259. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  260. ],
  261. ],
  262. ],
  263. [
  264. 'name' => '店铺管理',
  265. 'link' => 'wxapp',
  266. 'open_type' => 'wxapp',
  267. 'is_merchant' => 1,
  268. 'params' => [
  269. [
  270. 'key' => "appid",
  271. 'value' => "",
  272. 'desc' => "请填写小程序appid"
  273. ],
  274. [
  275. 'key' => "path",
  276. 'value' => "type=0&param=dianpu",
  277. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  278. ],
  279. ],
  280. ],
  281. [
  282. 'name' => '区域管理员',
  283. 'link' => 'wxapp',
  284. 'open_type' => 'wxapp',
  285. 'is_merchant' => 1,
  286. 'params' => [
  287. [
  288. 'key' => "appid",
  289. 'value' => "",
  290. 'desc' => "请填写小程序appid"
  291. ],
  292. [
  293. 'key' => "path",
  294. 'value' => "type=0&param=daili",
  295. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  296. ],
  297. ],
  298. ],
  299. [
  300. 'name' => '推广代理',
  301. 'link' => 'wxapp',
  302. 'open_type' => 'wxapp',
  303. 'is_merchant' => 1,
  304. 'params' => [
  305. [
  306. 'key' => "appid",
  307. 'value' => "",
  308. 'desc' => "请填写小程序appid"
  309. ],
  310. [
  311. 'key' => "path",
  312. 'value' => "type=0&param=tuiguang",
  313. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  314. ],
  315. ],
  316. ],
  317. [
  318. 'name' => '云仓批发',
  319. 'link' => 'wxapp',
  320. 'open_type' => 'wxapp',
  321. 'is_merchant' => 1,
  322. 'params' => [
  323. [
  324. 'key' => "appid",
  325. 'value' => "",
  326. 'desc' => "请填写小程序appid"
  327. ],
  328. [
  329. 'key' => "path",
  330. 'value' => "type=1&param=yuncang",
  331. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  332. ],
  333. ],
  334. ],
  335. [
  336. 'name' => '供货商申请',
  337. 'link' => 'wxapp',
  338. 'open_type' => 'wxapp',
  339. 'is_merchant' => 1,
  340. 'params' => [
  341. [
  342. 'key' => "appid",
  343. 'value' => "",
  344. 'desc' => "请填写小程序appid"
  345. ],
  346. [
  347. 'key' => "path",
  348. 'value' => "type=0&param=purchase",
  349. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  350. ],
  351. ],
  352. ],
  353. [
  354. 'name' => '云仓选品',
  355. 'link' => 'wxapp',
  356. 'open_type' => 'wxapp',
  357. 'is_merchant' => 1,
  358. 'params' => [
  359. [
  360. 'key' => "appid",
  361. 'value' => "",
  362. 'desc' => "请填写小程序appid"
  363. ],
  364. [
  365. 'key' => "path",
  366. 'value' => "type=2&param=yuncang",
  367. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  368. ],
  369. ],
  370. ],
  371. [
  372. 'name' => '联盟中心',
  373. 'link' => 'wxapp',
  374. 'open_type' => 'wxapp',
  375. 'is_merchant' => 1,
  376. 'params' => [
  377. [
  378. 'key' => "appid",
  379. 'value' => "",
  380. 'desc' => "请填写小程序appid"
  381. ],
  382. [
  383. 'key' => "path",
  384. 'value' => "type=0&param=fenxiao",
  385. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  386. ],
  387. ],
  388. ],
  389. [
  390. 'name' => '代理佣金',
  391. 'link' => 'wxapp',
  392. 'open_type' => 'wxapp',
  393. 'is_merchant' => 1,
  394. 'params' => [
  395. [
  396. 'key' => "appid",
  397. 'value' => "",
  398. 'desc' => "请填写小程序appid"
  399. ],
  400. [
  401. 'key' => "path",
  402. 'value' => "type=1&param=yongjin",
  403. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  404. ],
  405. ],
  406. ],
  407. [
  408. 'name' => '司机中心',
  409. 'link' => 'wxapp',
  410. 'open_type' => 'wxapp',
  411. 'is_merchant' => 1,
  412. 'params' => [
  413. [
  414. 'key' => "appid",
  415. 'value' => "",
  416. 'desc' => "请填写小程序appid"
  417. ],
  418. [
  419. 'key' => "path",
  420. 'value' => "type=0&param=driver",
  421. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  422. ],
  423. ],
  424. ]
  425. ];
  426. public static function getNewLink()
  427. {
  428. try {
  429. $groupDiyPage = [];
  430. $template = NewDiyTemplate::find()->where([
  431. 'store_id' => -1,
  432. 'is_index' => 0,
  433. 'is_delete' => 0,
  434. 'name' => 'DIY',
  435. ])->all();
  436. foreach($template as $item) {
  437. $info = Json::decode($item->template);
  438. $groupDiyPage[] = [
  439. 'name' => $info['page_name'],
  440. 'link' => "/pages/diy/diy?id=".$item->id,
  441. 'id' => $item->id,
  442. 'open_type' => "navigate",
  443. 'params' => []
  444. ];
  445. }
  446. $link = [
  447. 'name' => '商城页面',
  448. 'icon' => 'shop',
  449. 'child' => [
  450. [
  451. 'name' => 'DIY页面',
  452. 'list' => $groupDiyPage,
  453. 'type' => 'diy-page',
  454. ],
  455. [
  456. 'name' => '商城链接',
  457. 'child' => [
  458. [
  459. 'name' => '基础链接',
  460. 'list' => [
  461. [
  462. 'name' => '平台首页',
  463. 'link' => '/pages/home/home',
  464. 'open_type' => "switchtab",
  465. 'params' => []
  466. ],
  467. [
  468. 'name' => '购物车',
  469. 'link' => '/pages/shoppingcart/shoppingcart',
  470. 'open_type' => "switchtab",
  471. 'params' => []
  472. ],
  473. [
  474. 'name' => '用户中心',
  475. 'link' => '/pages/my/my',
  476. 'open_type' => "switchtab",
  477. 'params' => []
  478. ],
  479. ],
  480. ],
  481. [
  482. 'name' => '个人中心',
  483. 'list' => [
  484. [
  485. 'name' => '足迹',
  486. 'link' => '/user/history/history',
  487. 'open_type' => "navigate",
  488. 'params' => []
  489. ],
  490. [
  491. 'name' => '收货地址管理',
  492. 'link' => '/user/my/addressmanage',
  493. 'open_type' => "navigate",
  494. 'params' => []
  495. ],
  496. [
  497. 'name' => "所有订单",
  498. 'link' => "/order/order/order",
  499. 'open_type' => "navigate",
  500. 'params' => []
  501. ],
  502. [
  503. 'name' => "待付款订单",
  504. 'link' => "/order/order/order?status=0",
  505. 'open_type' => "navigate",
  506. 'params' => []
  507. ],
  508. [
  509. 'name' => "待发货订单",
  510. 'link' => "/order/order/order?status=1",
  511. 'open_type' => "navigate",
  512. 'params' => []
  513. ],
  514. [
  515. 'name' => "待收货订单",
  516. 'link' => "/order/order/order?status=2",
  517. 'open_type' => "navigate",
  518. 'params' => []
  519. ],
  520. [
  521. 'name' => "已完成订单",
  522. 'link' => "/order/order/order?status=3",
  523. 'open_type' => "navigate",
  524. 'params' => []
  525. ],
  526. [
  527. 'name' => '一键拨号',
  528. 'link' => 'tel',
  529. 'open_type' => 'tel',
  530. 'params' => [
  531. [
  532. 'key' => "tel",
  533. 'value' => "",
  534. 'desc' => "请填写联系电话"
  535. ]
  536. ],
  537. ],
  538. [
  539. 'name' => '小程序',
  540. 'link' => 'wxapp',
  541. 'open_type' => 'wxapp',
  542. 'params' => [
  543. [
  544. 'key' => "appid",
  545. 'value' => "",
  546. 'desc' => "请填写小程序appid"
  547. ],
  548. [
  549. 'key' => "path",
  550. 'value' => "",
  551. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  552. ],
  553. ],
  554. ],
  555. [
  556. 'name' => '客服',
  557. 'link' => 'contact',
  558. 'open_type' => 'contact',
  559. 'params' => []
  560. ],
  561. [
  562. 'name' => "店铺积分",
  563. 'link' => "/face-pay/face-pay/storePoints",
  564. 'open_type' => "navigate",
  565. 'params' => []
  566. ],
  567. [
  568. 'name' => "店铺收藏",
  569. 'link' => "/user/collection/collection",
  570. 'open_type' => "navigate",
  571. 'params' => []
  572. ],
  573. [
  574. 'name' => "核销员中心",
  575. 'link' => "/md_admin/staff-center/staff",
  576. 'open_type' => "navigate",
  577. 'params' => []
  578. ],
  579. // [
  580. // 'name' => "分账账户",
  581. // 'link' => "/user/share/share-account",
  582. // 'open_type' => "navigate",
  583. // 'params' => []
  584. // ]
  585. ],
  586. ]
  587. ],
  588. ],
  589. [
  590. 'name' => '应用',
  591. 'child' => [
  592. [
  593. 'name' => '优惠券',
  594. 'list' => [
  595. [
  596. 'name' => '领券中心',
  597. 'link' => '/pages/coupon_center/coupon_center',
  598. 'open_type' => "navigate",
  599. 'params' => []
  600. ],
  601. ],
  602. ],
  603. [
  604. 'name' => '卡券',
  605. 'list' => [
  606. [
  607. 'name' => '联盟会员卡',
  608. 'link' => '/user/member/saas_member',
  609. 'open_type' => "navigate",
  610. 'params' => []
  611. ],
  612. [
  613. 'name' => '我的卡券',
  614. 'link' => '/user/write_off_card/write_off_card',
  615. 'open_type' => 'navigate',
  616. 'params' => [],
  617. ],
  618. ],
  619. ],
  620. [
  621. 'name' => '积分商城',
  622. 'list' => [
  623. [
  624. 'name' => '积分首页',
  625. 'link' => '/marketing/integral/index/index',
  626. 'open_type' => "navigate",
  627. 'params' => []
  628. ],
  629. [
  630. 'name' => '我的兑换',
  631. 'link' => '/marketing/integral/my/record',
  632. 'open_type' => 'navigate',
  633. 'params' => [],
  634. ]
  635. ],
  636. ],
  637. [
  638. 'name' => '商盟活动',
  639. 'list' => [
  640. [
  641. 'name' => '商盟拼团',
  642. 'link' => '/marketing/other/pt/list/index',
  643. 'open_type' => "navigate",
  644. 'params' => []
  645. ],
  646. [
  647. 'name' => '我的拼团',
  648. 'link' => '/marketing/other/pt/order/index',
  649. 'open_type' => "navigate",
  650. 'params' => []
  651. ],
  652. [
  653. 'name' => '商盟砍价',
  654. 'link' => '/marketing/other/bargain/list/index',
  655. 'open_type' => "navigate",
  656. 'params' => []
  657. ],
  658. [
  659. 'name' => '我的砍价',
  660. 'link' => '/marketing/other/bargain/order/list/index',
  661. 'open_type' => "navigate",
  662. 'params' => []
  663. ],
  664. [
  665. 'name' => '商盟秒杀',
  666. 'link' => '/marketing/other/seckill/list/index',
  667. 'open_type' => "navigate",
  668. 'params' => []
  669. ],[
  670. 'name' => '新人专享',
  671. 'link' => '/marketing/other/newUser/list/index',
  672. 'open_type' => "navigate",
  673. 'params' => []
  674. ],
  675. ],
  676. ],
  677. [
  678. 'name' => '分红中心',
  679. 'list' => [
  680. [
  681. 'name' => '分红中心',
  682. 'link' => '/dividendCenter/index/index',
  683. 'open_type' => "navigate",
  684. 'params' => []
  685. ]
  686. ],
  687. ],
  688. ],
  689. ],
  690. [
  691. 'name' => '服务端功能',
  692. 'type' => 'serve',
  693. 'child' => [
  694. [
  695. 'name' => '服务端功能',
  696. 'type' => 'serve',
  697. 'list' => [
  698. [
  699. 'name' => '业务员',
  700. 'link' => 'wxapp',
  701. 'open_type' => 'wxapp',
  702. 'is_merchant' => 1,
  703. 'params' => [
  704. [
  705. 'key' => "appid",
  706. 'value' => "",
  707. 'desc' => "请填写小程序appid"
  708. ],
  709. [
  710. 'key' => "path",
  711. 'value' => "type=0&param=yewuyuan",
  712. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  713. ],
  714. ],
  715. ],
  716. [
  717. 'name' => '服务端小程序',
  718. 'link' => 'wxapp',
  719. 'open_type' => 'wxapp',
  720. 'is_merchant' => 1,
  721. 'params' => [
  722. [
  723. 'key' => "appid",
  724. 'value' => "",
  725. 'desc' => "请填写小程序appid"
  726. ],
  727. [
  728. 'key' => "path",
  729. 'value' => "pages/index/index",
  730. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  731. ],
  732. ],
  733. ],
  734. [
  735. 'name' => '店铺管理',
  736. 'link' => 'wxapp',
  737. 'open_type' => 'wxapp',
  738. 'is_merchant' => 1,
  739. 'params' => [
  740. [
  741. 'key' => "appid",
  742. 'value' => "",
  743. 'desc' => "请填写小程序appid"
  744. ],
  745. [
  746. 'key' => "path",
  747. 'value' => "type=0&param=dianpu",
  748. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  749. ],
  750. ],
  751. ],
  752. [
  753. 'name' => '区域管理员',
  754. 'link' => 'wxapp',
  755. 'open_type' => 'wxapp',
  756. 'is_merchant' => 1,
  757. 'params' => [
  758. [
  759. 'key' => "appid",
  760. 'value' => "",
  761. 'desc' => "请填写小程序appid"
  762. ],
  763. [
  764. 'key' => "path",
  765. 'value' => "type=0&param=daili",
  766. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  767. ],
  768. ],
  769. ],
  770. [
  771. 'name' => '推广代理',
  772. 'link' => 'wxapp',
  773. 'open_type' => 'wxapp',
  774. 'is_merchant' => 1,
  775. 'params' => [
  776. [
  777. 'key' => "appid",
  778. 'value' => "",
  779. 'desc' => "请填写小程序appid"
  780. ],
  781. [
  782. 'key' => "path",
  783. 'value' => "type=0&param=tuiguang",
  784. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  785. ],
  786. ],
  787. ],
  788. [
  789. 'name' => '云仓批发',
  790. 'link' => 'wxapp',
  791. 'open_type' => 'wxapp',
  792. 'is_merchant' => 1,
  793. 'params' => [
  794. [
  795. 'key' => "appid",
  796. 'value' => "",
  797. 'desc' => "请填写小程序appid"
  798. ],
  799. [
  800. 'key' => "path",
  801. 'value' => "type=1&param=yuncang",
  802. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  803. ],
  804. ],
  805. ],
  806. [
  807. 'name' => '供货商申请',
  808. 'link' => 'wxapp',
  809. 'open_type' => 'wxapp',
  810. 'is_merchant' => 1,
  811. 'params' => [
  812. [
  813. 'key' => "appid",
  814. 'value' => "",
  815. 'desc' => "请填写小程序appid"
  816. ],
  817. [
  818. 'key' => "path",
  819. 'value' => "type=0&param=purchase",
  820. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  821. ],
  822. ],
  823. ],
  824. [
  825. 'name' => '云仓选品',
  826. 'link' => 'wxapp',
  827. 'open_type' => 'wxapp',
  828. 'is_merchant' => 1,
  829. 'params' => [
  830. [
  831. 'key' => "appid",
  832. 'value' => "",
  833. 'desc' => "请填写小程序appid"
  834. ],
  835. [
  836. 'key' => "path",
  837. 'value' => "type=2&param=yuncang",
  838. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  839. ],
  840. ],
  841. ],
  842. [
  843. 'name' => '联盟中心',
  844. 'link' => 'wxapp',
  845. 'open_type' => 'wxapp',
  846. 'is_merchant' => 1,
  847. 'params' => [
  848. [
  849. 'key' => "appid",
  850. 'value' => "",
  851. 'desc' => "请填写小程序appid"
  852. ],
  853. [
  854. 'key' => "path",
  855. 'value' => "type=0&param=fenxiao",
  856. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  857. ],
  858. ],
  859. ],
  860. [
  861. 'name' => '代理佣金',
  862. 'link' => 'wxapp',
  863. 'open_type' => 'wxapp',
  864. 'is_merchant' => 1,
  865. 'params' => [
  866. [
  867. 'key' => "appid",
  868. 'value' => "",
  869. 'desc' => "请填写小程序appid"
  870. ],
  871. [
  872. 'key' => "path",
  873. 'value' => "type=1&param=yongjin",
  874. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  875. ],
  876. ],
  877. ],
  878. [
  879. 'name' => '司机中心',
  880. 'link' => 'wxapp',
  881. 'open_type' => 'wxapp',
  882. 'is_merchant' => 1,
  883. 'params' => [
  884. [
  885. 'key' => "appid",
  886. 'value' => "",
  887. 'desc' => "请填写小程序appid"
  888. ],
  889. [
  890. 'key' => "path",
  891. 'value' => "type=0&param=driver",
  892. 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
  893. ],
  894. ],
  895. ]
  896. ],
  897. ],
  898. ],
  899. ],
  900. ],
  901. ];
  902. foreach ($link['child'] as &$item) {
  903. if ($item['type'] === 'serve') {
  904. foreach ($item['child'][0]['list'] as &$s_item) {
  905. if ($s_item['is_merchant'] === 1) {
  906. if (isset($s_item['params'])) {
  907. foreach ($s_item['params'] as &$params) {
  908. if ($params['key'] === 'appid') {
  909. $platform_mch_appid = Option::get('platform_mch_appid', 0, 'saas')['value'];
  910. $params['value'] = $platform_mch_appid;
  911. }
  912. if ($params['key'] === 'path') {
  913. $params['value'] = '/pages/index/index?' . $params['value'];
  914. }
  915. }
  916. }
  917. }
  918. }
  919. }
  920. }
  921. return [$link, [
  922. 'name' => '店铺页面',
  923. 'icon' => 'shop',
  924. 'child' => [
  925. [
  926. 'name' => '店铺列表',
  927. 'type' => 'store-cat',
  928. 'typeLink' => [
  929. 'name' => '列表',
  930. 'link' => '/union/class-search/index',
  931. 'open_type' => "navigate",
  932. 'params' => [
  933. [
  934. 'key' => "common_cat_id",
  935. 'valueKey' => "id",
  936. 'value' => "",
  937. 'desc' => "common_cat_id请填写在商城分类中相关分类的ID",
  938. ]
  939. ]
  940. ],
  941. ],
  942. [
  943. 'name' => '跳转店铺',
  944. 'type' => 'change-store',
  945. 'typeLink' => [
  946. 'name' => '跳转店铺',
  947. 'link' => 'store',
  948. 'open_type' => "store",
  949. 'params' => [
  950. [
  951. 'key' => "store_id",
  952. 'valueKey' => "id",
  953. 'value' => "",
  954. 'desc' => "store_id请填写在商城分类中相关分类的ID",
  955. ]
  956. ]
  957. ],
  958. ]
  959. ]
  960. ]];
  961. } catch (\Exception $e) {
  962. return [
  963. 'code' => 1,
  964. 'msg' => $e->getMessage()
  965. ];
  966. }
  967. }
  968. public static function getLink()
  969. {
  970. $list = self::LIST;
  971. $template = NewDiyTemplate::find()->where([
  972. 'store_id' => -1,
  973. 'is_delete' => 0,
  974. 'name' => 'DIY',
  975. ])->all();
  976. foreach($template as $item) {
  977. $info = Json::decode($item->template);
  978. $list[] = [
  979. 'name' => $info['page_name'],
  980. 'link' => "/pages/diy/diy?id=".$item->id,
  981. 'open_type' => "navigate",
  982. 'params' => []
  983. ];
  984. }
  985. foreach ($list as &$item) {
  986. if (!empty($item['params'])) {
  987. foreach ($item['params'] as &$param_item) {
  988. //店铺列表
  989. if (!empty($param_item['key']) && $param_item['key'] === "common_cat_id" && $param_item['type'] === "select" ) {
  990. $param_item['options'] = SaasCategory::find()->where(['is_delete' => 0])->select('name, icon, id')->asArray()->all();
  991. }
  992. //跳转店铺
  993. if (!empty($param_item['key']) && $param_item['key'] === "store_id" && $param_item['type'] === "select" ) {
  994. $param_item['options'] = Store::find()->where(['is_delete' => 0])->select('name, logo, id')->asArray()->all();
  995. }
  996. }
  997. }
  998. if ($item['is_merchant'] === 1) {
  999. if (isset($item['params'])) {
  1000. foreach ($item['params'] as &$params) {
  1001. if ($params['key'] === 'appid') {
  1002. $platform_mch_appid = Option::get('platform_mch_appid', 0, 'saas')['value'];
  1003. $params['value'] = $platform_mch_appid;
  1004. }
  1005. if ($params['key'] === 'path') {
  1006. $params['value'] = '/pages/index/index?' . $params['value'];
  1007. }
  1008. }
  1009. }
  1010. }
  1011. }
  1012. return $list;
  1013. }
  1014. }