| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- /*
- * @Author: your name
- * @Date: 2021-03-02 09:50:20
- * @LastEditTime: 2021-05-21 11:56:14
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \admin_php\constants\PickLink.php
- */
- namespace app\constants;
- use app\models\NewDiyTemplate;
- use app\models\Option;
- use app\models\SaasCategory;
- use app\models\Store;
- use yii\helpers\Json;
- class PickLink
- {
- const LIST = [
- [
- 'name' => '平台首页',
- 'link' => '/pages/home/home',
- 'open_type' => "switchtab",
- 'params' => []
- ],
- [
- 'name' => '购物车',
- 'link' => '/pages/shoppingcart/shoppingcart',
- 'open_type' => "switchtab",
- 'params' => []
- ],
- [
- 'name' => '联盟会员卡',
- 'link' => '/user/member/saas_member',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '领券中心',
- 'link' => '/other/coupon_center/coupon_center',
- 'open_type' => "navigate",
- 'params' => []
- ],
- // [
- // 'name' => '联盟佣金',
- // 'link' => '/pages/union/user-account',
- // 'open_type' => "navigate",
- // 'params' => []
- // ],
- [
- 'name' => '足迹',
- 'link' => '/user/history/history',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '收货地址管理',
- 'link' => '/user/my/addressmanage',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '店铺列表',
- 'link' => '/union/class-search/index',
- 'open_type' => "navigate",
- 'params' => [
- [
- 'key' => "common_cat_id",
- 'value' => "",
- 'desc' => "商城分类ID",
- 'type' => "select",
- 'options' => [],
- 'label_name' => "商城分类"
- ],
- [
- 'key' => "cat_name",
- 'value' => "",
- 'label_name' => "商城分类名称",
- 'hidden' => true
- ],
- ]
- ],
- [
- 'name' => '用户中心',
- 'link' => '/pages/my/my',
- 'open_type' => "switchtab",
- 'params' => []
- ],
- [
- 'name' => "所有订单",
- 'link' => "/order/order/order",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "待付款订单",
- 'link' => "/order/order/order?status=0",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "待发货订单",
- 'link' => "/order/order/order?status=1",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "待收货订单",
- 'link' => "/order/order/order?status=2",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "已完成订单",
- 'link' => "/order/order/order?status=3",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '一键拨号',
- 'link' => 'tel',
- 'open_type' => 'tel',
- 'params' => [
- [
- 'key' => "tel",
- 'value' => "",
- 'desc' => "请填写联系电话"
- ]
- ],
- ],
- [
- 'name' => '小程序',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '客服',
- 'link' => 'contact',
- 'open_type' => 'contact',
- 'params' => []
- ],
- [
- 'name' => '业务员',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=yewuyuan",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- // [
- // 'name' => '申请店铺',
- // 'link' => '/salesman/salesman/applyShop',
- // 'open_type' => 'navigate',
- // 'params' => [],
- // ],
- // [
- // 'name' => '代理中心',
- // 'link' => '/salesman/salesman/agencyCenter',
- // 'open_type' => 'navigate',
- // 'params' => [],
- // ],
- // [
- // 'name' => '商城后台',
- // 'link' => '/admin/home/home',
- // 'open_type' => 'navigate',
- // 'params' => [],
- // ],
- [
- 'name' => '我的卡券',
- 'link' => '/user/write_off_card/write_off_card',
- 'open_type' => 'navigate',
- 'params' => [],
- ],
- [
- 'name' => '跳转店铺',
- 'link' => 'store',
- 'open_type' => 'store',
- 'params' => [
- [
- 'key' => "store_id",
- 'value' => "",
- 'desc' => "跳转店铺首页",
- 'type' => "select",
- 'options' => [],
- 'label_name' => "选择店铺"
- ],
- ],
- ],
- [
- 'name' => "我的积分",
- 'link' => "/face-pay/face-pay/storePoints",
- 'open_type' => "navigate",
- 'params' => []
- ],
- // [
- // 'name' => "分销中心",
- // 'link' => "/user/share/index",
- // 'open_type' => "navigate",
- // 'params' => []
- // ],
- // [
- // 'name' => "佣金统计",
- // 'link' => "/user/brokerageCharges/index",
- // 'open_type' => "navigate",
- // 'params' => []
- // ],
- // [
- // 'name' => "消费返利",
- // 'link' => "/user/rebate/index",
- // 'open_type' => "navigate",
- // 'params' => []
- // ],
- [
- 'name' => '分账账户',
- 'link' => '/user/share/share-account',
- 'open_type' => 'navigate',
- 'params' => [],
- ],
- [
- 'name' => '服务端小程序',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "pages/index/index",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '店铺管理',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=dianpu",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '区域管理员',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=daili",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '推广代理',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=tuiguang",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '云仓批发',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=1¶m=yuncang",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '供货商申请',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=purchase",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '云仓选品',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=2¶m=yuncang",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '联盟中心',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=fenxiao",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '代理佣金',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=1¶m=yongjin",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '司机中心',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=driver",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ]
- ];
- public static function getNewLink()
- {
- try {
- $groupDiyPage = [];
- $template = NewDiyTemplate::find()->where([
- 'store_id' => -1,
- 'is_index' => 0,
- 'is_delete' => 0,
- 'name' => 'DIY',
- ])->all();
- foreach($template as $item) {
- $info = Json::decode($item->template);
- $groupDiyPage[] = [
- 'name' => $info['page_name'],
- 'link' => "/pages/diy/diy?id=".$item->id,
- 'id' => $item->id,
- 'open_type' => "navigate",
- 'params' => []
- ];
- }
- $link = [
- 'name' => '商城页面',
- 'icon' => 'shop',
- 'child' => [
- [
- 'name' => 'DIY页面',
- 'list' => $groupDiyPage,
- 'type' => 'diy-page',
- ],
- [
- 'name' => '商城链接',
- 'child' => [
- [
- 'name' => '基础链接',
- 'list' => [
- [
- 'name' => '平台首页',
- 'link' => '/pages/home/home',
- 'open_type' => "switchtab",
- 'params' => []
- ],
- [
- 'name' => '购物车',
- 'link' => '/pages/shoppingcart/shoppingcart',
- 'open_type' => "switchtab",
- 'params' => []
- ],
- [
- 'name' => '用户中心',
- 'link' => '/pages/my/my',
- 'open_type' => "switchtab",
- 'params' => []
- ],
- ],
- ],
- [
- 'name' => '个人中心',
- 'list' => [
- [
- 'name' => '足迹',
- 'link' => '/user/history/history',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '收货地址管理',
- 'link' => '/user/my/addressmanage',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "所有订单",
- 'link' => "/order/order/order",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "待付款订单",
- 'link' => "/order/order/order?status=0",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "待发货订单",
- 'link' => "/order/order/order?status=1",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "待收货订单",
- 'link' => "/order/order/order?status=2",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "已完成订单",
- 'link' => "/order/order/order?status=3",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '一键拨号',
- 'link' => 'tel',
- 'open_type' => 'tel',
- 'params' => [
- [
- 'key' => "tel",
- 'value' => "",
- 'desc' => "请填写联系电话"
- ]
- ],
- ],
- [
- 'name' => '小程序',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '客服',
- 'link' => 'contact',
- 'open_type' => 'contact',
- 'params' => []
- ],
- [
- 'name' => "店铺积分",
- 'link' => "/face-pay/face-pay/storePoints",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "店铺收藏",
- 'link' => "/user/collection/collection",
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => "核销员中心",
- 'link' => "/md_admin/staff-center/staff",
- 'open_type' => "navigate",
- 'params' => []
- ],
- // [
- // 'name' => "分账账户",
- // 'link' => "/user/share/share-account",
- // 'open_type' => "navigate",
- // 'params' => []
- // ]
- ],
- ]
- ],
- ],
- [
- 'name' => '应用',
- 'child' => [
- [
- 'name' => '优惠券',
- 'list' => [
- [
- 'name' => '领券中心',
- 'link' => '/pages/coupon_center/coupon_center',
- 'open_type' => "navigate",
- 'params' => []
- ],
- ],
- ],
- [
- 'name' => '卡券',
- 'list' => [
- [
- 'name' => '联盟会员卡',
- 'link' => '/user/member/saas_member',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '我的卡券',
- 'link' => '/user/write_off_card/write_off_card',
- 'open_type' => 'navigate',
- 'params' => [],
- ],
- ],
- ],
- [
- 'name' => '积分商城',
- 'list' => [
- [
- 'name' => '积分首页',
- 'link' => '/marketing/integral/index/index',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '我的兑换',
- 'link' => '/marketing/integral/my/record',
- 'open_type' => 'navigate',
- 'params' => [],
- ]
- ],
- ],
- [
- 'name' => '商盟活动',
- 'list' => [
- [
- 'name' => '商盟拼团',
- 'link' => '/marketing/other/pt/list/index',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '我的拼团',
- 'link' => '/marketing/other/pt/order/index',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '商盟砍价',
- 'link' => '/marketing/other/bargain/list/index',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '我的砍价',
- 'link' => '/marketing/other/bargain/order/list/index',
- 'open_type' => "navigate",
- 'params' => []
- ],
- [
- 'name' => '商盟秒杀',
- 'link' => '/marketing/other/seckill/list/index',
- 'open_type' => "navigate",
- 'params' => []
- ],[
- 'name' => '新人专享',
- 'link' => '/marketing/other/newUser/list/index',
- 'open_type' => "navigate",
- 'params' => []
- ],
- ],
- ],
- [
- 'name' => '分红中心',
- 'list' => [
- [
- 'name' => '分红中心',
- 'link' => '/dividendCenter/index/index',
- 'open_type' => "navigate",
- 'params' => []
- ]
- ],
- ],
- ],
- ],
- [
- 'name' => '服务端功能',
- 'type' => 'serve',
- 'child' => [
- [
- 'name' => '服务端功能',
- 'type' => 'serve',
- 'list' => [
- [
- 'name' => '业务员',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=yewuyuan",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '服务端小程序',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "pages/index/index",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '店铺管理',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=dianpu",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '区域管理员',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=daili",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '推广代理',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=tuiguang",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '云仓批发',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=1¶m=yuncang",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '供货商申请',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=purchase",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '云仓选品',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=2¶m=yuncang",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '联盟中心',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=fenxiao",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '代理佣金',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=1¶m=yongjin",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ],
- [
- 'name' => '司机中心',
- 'link' => 'wxapp',
- 'open_type' => 'wxapp',
- 'is_merchant' => 1,
- 'params' => [
- [
- 'key' => "appid",
- 'value' => "",
- 'desc' => "请填写小程序appid"
- ],
- [
- 'key' => "path",
- 'value' => "type=0¶m=driver",
- 'desc' => "打开的页面路径,如pages/index/index,开头请勿加“/”"
- ],
- ],
- ]
- ],
- ],
- ],
- ],
- ],
- ];
- foreach ($link['child'] as &$item) {
- if ($item['type'] === 'serve') {
- foreach ($item['child'][0]['list'] as &$s_item) {
- if ($s_item['is_merchant'] === 1) {
- if (isset($s_item['params'])) {
- foreach ($s_item['params'] as &$params) {
- if ($params['key'] === 'appid') {
- $platform_mch_appid = Option::get('platform_mch_appid', 0, 'saas')['value'];
- $params['value'] = $platform_mch_appid;
- }
- if ($params['key'] === 'path') {
- $params['value'] = '/pages/index/index?' . $params['value'];
- }
- }
- }
- }
- }
- }
- }
- return [$link, [
- 'name' => '店铺页面',
- 'icon' => 'shop',
- 'child' => [
- [
- 'name' => '店铺列表',
- 'type' => 'store-cat',
- 'typeLink' => [
- 'name' => '列表',
- 'link' => '/union/class-search/index',
- 'open_type' => "navigate",
- 'params' => [
- [
- 'key' => "common_cat_id",
- 'valueKey' => "id",
- 'value' => "",
- 'desc' => "common_cat_id请填写在商城分类中相关分类的ID",
- ]
- ]
- ],
- ],
- [
- 'name' => '跳转店铺',
- 'type' => 'change-store',
- 'typeLink' => [
- 'name' => '跳转店铺',
- 'link' => 'store',
- 'open_type' => "store",
- 'params' => [
- [
- 'key' => "store_id",
- 'valueKey' => "id",
- 'value' => "",
- 'desc' => "store_id请填写在商城分类中相关分类的ID",
- ]
- ]
- ],
- ]
- ]
- ]];
- } catch (\Exception $e) {
- return [
- 'code' => 1,
- 'msg' => $e->getMessage()
- ];
- }
- }
- public static function getLink()
- {
- $list = self::LIST;
- $template = NewDiyTemplate::find()->where([
- 'store_id' => -1,
- 'is_delete' => 0,
- 'name' => 'DIY',
- ])->all();
- foreach($template as $item) {
- $info = Json::decode($item->template);
- $list[] = [
- 'name' => $info['page_name'],
- 'link' => "/pages/diy/diy?id=".$item->id,
- 'open_type' => "navigate",
- 'params' => []
- ];
- }
- foreach ($list as &$item) {
- if (!empty($item['params'])) {
- foreach ($item['params'] as &$param_item) {
- //店铺列表
- if (!empty($param_item['key']) && $param_item['key'] === "common_cat_id" && $param_item['type'] === "select" ) {
- $param_item['options'] = SaasCategory::find()->where(['is_delete' => 0])->select('name, icon, id')->asArray()->all();
- }
- //跳转店铺
- if (!empty($param_item['key']) && $param_item['key'] === "store_id" && $param_item['type'] === "select" ) {
- $param_item['options'] = Store::find()->where(['is_delete' => 0])->select('name, logo, id')->asArray()->all();
- }
- }
- }
- if ($item['is_merchant'] === 1) {
- if (isset($item['params'])) {
- foreach ($item['params'] as &$params) {
- if ($params['key'] === 'appid') {
- $platform_mch_appid = Option::get('platform_mch_appid', 0, 'saas')['value'];
- $params['value'] = $platform_mch_appid;
- }
- if ($params['key'] === 'path') {
- $params['value'] = '/pages/index/index?' . $params['value'];
- }
- }
- }
- }
- }
- return $list;
- }
- }
|