SurveyController.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: yunzhong
  5. * Date: 2019/7/1
  6. * Time: 14:55
  7. */
  8. namespace app\backend\modules\survey\controllers;
  9. use app\backend\models\Withdraw;
  10. use app\backend\modules\member\models\MemberShopInfo;
  11. use app\backend\modules\menu\Menu;
  12. use app\common\components\BaseController;
  13. use app\common\helpers\Cache;
  14. use app\common\models\Goods;
  15. use app\common\models\Order;
  16. use app\common\models\Setting;
  17. use app\common\services\CollectHostService;
  18. use app\common\services\System;
  19. use app\host\HostManager;
  20. use Carbon\Carbon;
  21. use Illuminate\Support\Facades\DB;
  22. use mysql_xdevapi\Exception;
  23. use Predis\Connection\ConnectionException;
  24. use Yunshop\BrowseFootprint\models\BrowseFootprintModel;
  25. use Yunshop\BrowseFootprint\services\IndexPageService;
  26. use Yunshop\Love\Common\Models\MemberShop;
  27. use EasyWeChat\Factory;
  28. class SurveyController extends BaseController
  29. {
  30. public function index()
  31. {
  32. return view('survey.index');
  33. }
  34. private function _allData()
  35. {
  36. ini_set('memory_limit',-1);
  37. (new CollectHostService(request()->getHttpHost()))->handle();
  38. //销售量前10条数据
  39. $goods = Goods::uniacid()->orderBy('real_sales', 'desc')->offset(0)
  40. ->take(10)->select('id', 'title', 'real_sales', 'created_at')->get();
  41. //订单数据
  42. $start_today = strtotime(Carbon::now()->startOfDay()->format('Y-m-d H:i:s'));
  43. $end_today = strtotime(Carbon::now()->endOfDay()->format('Y-m-d H:i:s'));
  44. //不统计的订单plugin_id
  45. $without_count_plugin_id = \app\common\modules\shop\ShopConfig::current()->get('without_count_order_plugin_id') ?: [];
  46. //获取已开启的且不在不统计的订单的插件id
  47. $pluginIds=array_column((new \app\backend\modules\order\services\OrderViewService)->getOrderType(),'plugin_id');
  48. $pluginIds=array_filter($pluginIds,function($item)use($without_count_plugin_id){
  49. return !in_array($item,$without_count_plugin_id);
  50. });
  51. $where = [['uniacid', \YunShop::app()->uniacid]];
  52. $orderResult = DB::table('yz_order')->selectRaw('status, count(status) as total')->where($where)->whereIn('plugin_id',$pluginIds)->whereIn('status', [0, 1])->groupBy('status')->get();
  53. foreach ($orderResult as $rows) {
  54. //待支付订单
  55. if ($rows['status'] == 0) {
  56. $to_be_paid = $rows['total'];
  57. }
  58. //待发货订单
  59. if ($rows['status'] == 1) {
  60. $to_be_shipped = $rows['total'];
  61. }
  62. }
  63. //今日订单数据
  64. $today_order = DB::table('yz_order')->selectRaw('sum(price) as money , count(id) as total')->where($where)->whereIn('plugin_id',$pluginIds)->whereBetween('created_at', [$start_today, $end_today])->whereIn('status', [1, 2, 3])->first();
  65. //会员总数
  66. $member = DB::table('mc_members')
  67. ->select([DB::raw('count(1) as total')])
  68. ->where('mc_members.uniacid', \YunShop::app()->uniacid)
  69. ->join('yz_member', 'mc_members.uid', '=', 'yz_member.member_id')
  70. ->whereNull('yz_member.deleted_at')
  71. ->first();
  72. //=============获取图表数据
  73. $all_data = [
  74. 'goods' => $goods,
  75. 'member_count' => $member['total'],
  76. 'member_count_icon' => 'icon-fontclass-renshu',
  77. 'chart_data' => $this->getOrderData(),
  78. 'system_icon' => 'icon-fontclass-deng',
  79. 'order' => [
  80. 'to_be_paid' => $to_be_paid ?: 0,
  81. 'to_be_shipped' => $to_be_shipped ?: 0,
  82. 'today_order_money' => $today_order['money'] ?: 0,
  83. 'today_order_count' => $today_order['total'] ?: 0,
  84. 'paid_icon' => 'icon-ht_content_tixian',
  85. 'shipped_icon' => 'icon-ht_content_order',
  86. 'order_money_icon' => 'icon-fontclass-yue (1)',
  87. 'order_count_icon' => 'icon-fontclass-shangpindingdan (1)'
  88. ],
  89. 'entrance' => $this->getEntrance(),
  90. 'guide' => $this->getBasicGuidance(),
  91. 'withdrawal' => $this->getWithdrawal(),
  92. 'visitor' => $this->getVisitor(),
  93. 'is_enabled_statistics' => 0,
  94. 'order_url' => '',
  95. 'sales_url' => '',
  96. ];
  97. if (app('plugins')->isEnabled('shop-statistics')) {
  98. $all_data['is_enabled_statistics'] = 1;
  99. $all_data['order_url'] = yzWebFullUrl('plugin.shop-statistics.backend.order.show');
  100. $all_data['sales_url'] = yzWebFullUrl('plugin.shop-statistics.backend.goods.show');
  101. }
  102. return $all_data;
  103. }
  104. public function survey()
  105. {
  106. // dd($this->_allData());
  107. return $this->successJson('成功', $this->_allData());
  108. }
  109. private function getOrderData()
  110. {
  111. $times = $this->timeRangeItems();
  112. $result = [];
  113. foreach ($times as $time) {
  114. $item['total'] = $this->orderTotals(null, 'create_time', $time) ?: 0;
  115. $item['complete'] = $this->orderTotals(3, 'finish_time', $time) ?: 0;
  116. $item['deliver_goods'] = $this->orderTotals(2, 'send_time', $time) ?: 0;
  117. $item['date'] = $time;
  118. $result[] = $item;
  119. }
  120. return $result;
  121. }
  122. /**
  123. * 获取一星期的时间
  124. * @return array
  125. */
  126. public function timeRangeItems()
  127. {
  128. $result = [];
  129. for ($i = 6; $i > -1; $i--) {
  130. Carbon::now()->subDay($i)->format('Y-m-d');
  131. $result[] = Carbon::now()->subDay($i)->format('Y-m-d');
  132. }
  133. return $result;
  134. }
  135. private $orderTotals;
  136. private function orderTotals($status, $timeField, $date)
  137. {
  138. if (!isset($this->orderTotals[$timeField])) {
  139. $allDate = Order::uniacid()->getQuery()
  140. ->select(DB::raw("count(1) as total, FROM_UNIXTIME(" . $timeField . ",'%Y-%m-%d') as date_str"))
  141. ->whereBetween($timeField, [Carbon::now()->subDay(6)->startOfDay()->timestamp, Carbon::now()->endOfDay()->timestamp])
  142. ->groupBy(DB::raw('YEAR(date_str), MONTH(date_str), DAY(date_str)'));
  143. if (isset($status)) {
  144. $allDate->where('status', $status);
  145. }
  146. $allDate = $allDate->get();
  147. $this->orderTotals[$timeField] = [];
  148. foreach ($allDate as $item) {
  149. $this->orderTotals[$timeField][$item['date_str']] = $item['total'];
  150. }
  151. }
  152. return $this->orderTotals[$timeField][$date];
  153. }
  154. private function getSystemStatus()
  155. {
  156. return (new System())->index();
  157. }
  158. /**
  159. * 基础功能指引
  160. * @return array
  161. */
  162. private function getBasicGuidance()
  163. {
  164. $guide_list = $this->getGuideList();
  165. foreach ($guide_list as $k => &$v) {
  166. foreach ($v['list'] as $k2 => &$v2) {
  167. if (isset($v2['supper_admin']) and $v2['supper_admin'] === 1) {
  168. if (!(\YunShop::app()->role === 'founder')) {
  169. unset($guide_list[$k]['list'][$k2]);
  170. continue;
  171. }
  172. }
  173. $v2['url'] = yzWebFullUrl($v2['route'], $v2['param'] ?: []);
  174. $v2['is_enabled'] = 0;
  175. if ($v2['is_plugin'] == 1) {
  176. $route_array = explode('.', $v2['route']);
  177. if (app('plugins')->isEnabled($route_array[1])) {
  178. $v2['is_enabled'] = 1;
  179. } else {
  180. $v2['url'] = '';
  181. }
  182. }
  183. if (isset($v2['special_param']) and $v2['special_param']) {
  184. $v2['url'] .= $v2['special_param'];
  185. }
  186. unset($v2['route'], $v2['param'], $v2['special_param']);
  187. }
  188. }
  189. $data = array(
  190. 'list' => $guide_list
  191. );
  192. return $data;
  193. }
  194. /**
  195. * 主要入口
  196. * @return array
  197. */
  198. private function getEntrance()
  199. {
  200. $data = array(
  201. 'home_url' => yzAppFullUrl('home'),
  202. 'home_code' => '',
  203. 'more_home_url' => yzWebFullUrl('setting.shop.entry'),
  204. 'is_enabled_mini_app' => 0,
  205. 'is_mini_app_config' => 0,
  206. 'mini_app_code' => '',
  207. 'is_enabled_customer_service' => 0,
  208. 'customer_service_url' => '',
  209. 'is_enabled_contract' => 0,
  210. 'is_contract_config' => 0,
  211. 'contract_url' => '',
  212. );
  213. // 商城首页二维码
  214. $code = new \app\common\helpers\QrCodeHelper($data['home_url'], 'app/public/qr/home/' . \YunShop::app()->uniacid);
  215. if ($home_code = $code->url()) {
  216. $data['home_code'] = $home_code;
  217. } else $data['home_code_error'] = '生成网页二维码失败';
  218. // 小程序二维码
  219. if (app('plugins')->isEnabled('min-app')) {
  220. $data['is_enabled_mini_app'] = 1;
  221. $setting = \Setting::get('plugin.min_app');
  222. if ($setting['switch'] and $setting['key'] and $setting['secret']) {
  223. $data['is_mini_app_config'] = 1;
  224. if (!(($mini_code = Cache::get('survey_mini_app_code')) and file_exists($mini_code))) {
  225. // 生成小程序二维码,图片保存到storage目录
  226. $config = [
  227. 'app_id' => $setting['key'],
  228. 'secret' => $setting['secret'],
  229. ];
  230. $min_url = 'packageG/index/index';
  231. try {
  232. $app = Factory::miniProgram($config);
  233. $response = $app->app_code->getUnlimit('scene-value', ['page' => $min_url, 'width' => 600]);
  234. if (is_array($response) && isset($response['errcode'])) {
  235. throw new \Exception('生成小程序码失败,' . $response['errcode'] . ':' . $response['errmsg']);
  236. }
  237. if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
  238. if (config('app.framework') == 'platform') {
  239. $file_path = base_path('storage/app/public/qr/home');
  240. } else {
  241. $file_path = dirname(dirname(base_path())) . '/attachment/app/public/qr/home';
  242. }
  243. $filename = $response->saveAs($file_path, 'home_mini_code_' . \YunShop::app()->uniacid);
  244. }
  245. if (isset($filename)) {
  246. Cache::put('survey_mini_app_code', $file_path . '/' . $filename, 60);
  247. $data['mini_app_code'] = yz_tomedia($file_path . '/' . $filename);
  248. } else {
  249. $data['mini_app_code_error'] = '保存小程序码失败';
  250. }
  251. } catch (\Exception $e) {
  252. $data['mini_app_code_error'] = '生成小程序码失败,请检查配置';
  253. }
  254. } else {
  255. $data['mini_app_code'] = yz_tomedia($mini_code);
  256. }
  257. } else {
  258. $data['is_mini_app_config'] = 0;
  259. }
  260. }
  261. // 客服登录
  262. if (app('plugins')->isEnabled('yunqian-pc')) {
  263. $data['is_enabled_customer_service'] = 1;
  264. $domain = request()->getSchemeAndHttpHost();
  265. $data['customer_service_url'] = $domain . "/addons/yun_shop/plugins/yunqian-pc/public/index.html?i=" . \YunShop::app()->uniacid;
  266. if (config('app.framework') == 'platform') {
  267. $data['customer_service_url'] = $domain . "/plugins/yunqian-pc/platform/index.html?i=" . \YunShop::app()->uniacid;
  268. }
  269. }
  270. // 电子合同管理
  271. if (app('plugins')->isEnabled('yun-sign')) {
  272. $data['is_enabled_contract'] = 1;
  273. $setting = \Setting::get('plugin.yun-sign');
  274. if ($setting['short_url_front']) {
  275. $data['is_contract_config'] = 1;
  276. $data['contract_url'] = $setting['short_url_front'];
  277. }
  278. }
  279. return $data;
  280. }
  281. private function deleteCode()
  282. {
  283. // 删除旧数据
  284. Setting::uniacid()->where('group', 'shop')->where('key', 'like', 'mini_code%')->delete();
  285. }
  286. /**
  287. * 提现动态
  288. * @return array
  289. */
  290. private function getWithdrawal()
  291. {
  292. $list = Withdraw::with(['hasOneMember' => function ($query) {
  293. return $query->select('uid', 'nickname', 'avatar');
  294. }])->select('id', 'member_id', 'created_at', 'amounts')
  295. ->orderBy('created_at', 'desc')
  296. ->limit(20)
  297. ->get();
  298. $data = array(
  299. 'url' => yzWebFullUrl('withdraw.records'),
  300. 'list' => $list
  301. );
  302. return $data;
  303. }
  304. /**
  305. * 访客播报
  306. * @return array
  307. */
  308. private function getVisitor()
  309. {
  310. $data = [
  311. 'is_enabled' => 0,
  312. 'url' => '',
  313. 'list' => array()
  314. ];
  315. if (app('plugins')->isEnabled('browse-footprint')) {
  316. $data['is_enabled'] = 1;
  317. $data['url'] = yzWebFullUrl('plugin.browse-footprint.admin.index.index');
  318. $prefix = app('db')->getTablePrefix();
  319. $uniacid = \YunShop::app()->uniacid;
  320. $list = BrowseFootprintModel::select('created_at', 'port_type', 'ip', 'ip_name', 'member_id', 'cookie', 'day', 'url')
  321. ->from(DB::raw("(select * from {$prefix}yz_browse_footprint where uniacid = $uniacid order by id desc limit 5000) as {$prefix}yz_browse_footprint"))
  322. ->with([
  323. 'hasOneMember' => function ($q) {
  324. $q->select('uid', 'nickname', 'avatar', 'realname');
  325. }
  326. ])
  327. ->search([])
  328. ->groupBy('cookie', 'member_id')
  329. ->orderBy('created_at', 'desc')
  330. ->orderBy('id', 'desc')
  331. ->paginate(20);
  332. // 判断新老访客
  333. $cookie_arr = $list->pluck('cookie')->toArray();
  334. $member_arr = $list->pluck('member_id')->toArray();
  335. $merge_arr = array_merge($cookie_arr, $member_arr);
  336. $day_arr = BrowseFootprintModel::selectRaw('min(day) as min_day,cookie,member_id')
  337. ->from(DB::raw("(select * from {$prefix}yz_browse_footprint where uniacid = $uniacid order by id desc limit 5000) as {$prefix}yz_browse_footprint"))
  338. ->where(function ($query) use ($merge_arr) {
  339. foreach ($merge_arr as $item) {
  340. if ($item == null) {
  341. continue;
  342. }
  343. if (is_numeric($item)) {
  344. $query->orWhere('member_id', $item);
  345. } else {
  346. $query->orWhere('cookie', $item);
  347. }
  348. }
  349. })
  350. ->groupBy('cookie')
  351. ->get();
  352. $member_ids = $real_day_arr = [];
  353. foreach ($day_arr as $item) {
  354. if ($item->member_id != 0 && in_array($item->member_id, $member_ids)) {
  355. $bccomp = bccomp($item->min_day, $real_day_arr[$item->member_id]);//左边大=》1 右边大=》-1
  356. //更小就替换
  357. if (!$bccomp) {
  358. $real_day_arr[$item->member_id] = $item->min_day;
  359. }
  360. continue;//替换中断
  361. }
  362. $real_day_arr[$item->member_id] = $item->min_day;
  363. $member_ids[] = $item->member_id;
  364. }
  365. unset($real_day_arr[0]);//去除0的数据
  366. $portion_day_arr = $day_arr->pluck('min_day', 'cookie');
  367. foreach ($list as $key => $item) {
  368. $list_data[] = [
  369. 'access_time' => $item->created_at->toDateTimeString(),
  370. 'cookie_type' => $this->getCookieType($item->day, $item->cookie, $portion_day_arr, $real_day_arr, $item->member_id),
  371. 'name' => $item->hasOneMember->username ?: '',
  372. 'avatar_image' => $item->hasOneMember->avatar_image ?: '',
  373. 'uid' => $item->hasOneMember->uid
  374. ];
  375. }
  376. $data['list'] = $list_data ?: [];
  377. }
  378. return $data;
  379. }
  380. /**
  381. * 判断新老访客
  382. * @param $item_day
  383. * @param $item_cookie
  384. * @param $portion_day_arr
  385. * @param $real_day_arr
  386. * @param $item_member_id
  387. * @return string
  388. */
  389. private function getCookieType($item_day, $item_cookie, $portion_day_arr, $real_day_arr, $item_member_id)
  390. {
  391. //存在
  392. if (!empty($real_day_arr[$item_member_id])) {
  393. $times[$item_cookie] = $real_day_arr[$item_member_id];
  394. } else {
  395. $times[$item_cookie] = $portion_day_arr[$item_cookie];
  396. }
  397. return $item_day == $times[$item_cookie] ? 'new' : 'old';
  398. }
  399. // 基础功能指引
  400. private function getGuideList()
  401. {
  402. $basic_guidance = array(
  403. [
  404. 'title' => '基础设置',
  405. 'list' => [
  406. [
  407. 'name' => '安装应用',
  408. 'route' => 'plugin.plugins-market.Controllers.new-market.show',
  409. 'is_plugin' => 1,
  410. 'icon' => 'icon-fontclass-anzhuang',
  411. 'supper_admin' => 1,
  412. ],
  413. [
  414. 'name' => '启动应用',
  415. 'route' => 'plugins.get-plugin-data',
  416. 'is_plugin' => 0,
  417. 'icon' => 'icon-fontclass-mendianfenlei',
  418. 'supper_admin' => 1,
  419. ],
  420. [
  421. 'name' => '设置商城信息',
  422. 'route' => 'setting.shop.index',
  423. 'is_plugin' => 0,
  424. 'icon' => 'icon-fontclass-mendianguanli'
  425. ],
  426. [
  427. 'name' => '设置短信',
  428. 'route' => 'setting.shop.sms',
  429. 'is_plugin' => 0,
  430. 'icon' => 'icon-fontclass-yanzhengma'
  431. ],
  432. [
  433. 'name' => '设置物流查询',
  434. 'route' => 'setting.shop.express-info',
  435. 'is_plugin' => 0,
  436. 'icon' => 'icon-massage_trade_logistics'
  437. ],
  438. [
  439. 'name' => '添加操作员',
  440. 'route' => 'user.user.index',
  441. 'is_plugin' => 0,
  442. 'icon' => 'icon-massage_client'
  443. ],
  444. [
  445. 'name' => '前端入口',
  446. 'route' => 'setting.shop.entry',
  447. 'is_plugin' => 0,
  448. 'icon' => 'icon-wj_record'
  449. ],
  450. [
  451. 'name' => '接入微信公众号',
  452. 'route' => 'plugin.wechat.admin.setting.setting',
  453. 'is_plugin' => 1,
  454. 'icon' => 'icon-fontclass-gongzonghao1'
  455. ],
  456. [
  457. 'name' => '接入微信小程序',
  458. 'route' => 'plugin.min-app.Backend.Controllers.base-set',
  459. 'is_plugin' => 1,
  460. 'icon' => 'icon-all_smallprogram'
  461. ],
  462. [
  463. 'name' => '支付方式',
  464. 'route' => 'setting.shop.pay',
  465. 'is_plugin' => 0,
  466. 'icon' => 'icon-fontclass-zhifufangshi'
  467. ],
  468. [
  469. 'name' => '微信模板消息',
  470. 'route' => 'setting.shop.notice',
  471. 'is_plugin' => 0,
  472. 'icon' => 'icon-xuanchuantuiguang'
  473. ]
  474. ]
  475. ],
  476. [
  477. 'title' => '商品与页面',
  478. 'list' => [
  479. [
  480. 'name' => '商品分类层级',
  481. 'route' => 'setting.shop.category',
  482. 'is_plugin' => 0,
  483. 'icon' => 'icon-fontclass-fenleicengji'
  484. ],
  485. [
  486. 'name' => '商品分类设置',
  487. 'route' => 'goods.category.index',
  488. 'is_plugin' => 0,
  489. 'icon' => 'icon-fontclass-anzhuang'
  490. ],
  491. [
  492. 'name' => '商品品牌设置',
  493. 'route' => 'goods.brand.index',
  494. 'is_plugin' => 0,
  495. 'icon' => 'icon-fontclass-shouchu'
  496. ],
  497. [
  498. 'name' => '配送模板设置',
  499. 'route' => 'goods.dispatch.index',
  500. 'is_plugin' => 0,
  501. 'icon' => 'icon-fontclass-jinhuo'
  502. ],
  503. [
  504. 'name' => '发布商品',
  505. 'route' => 'goods.goods.create',
  506. 'is_plugin' => 0,
  507. 'icon' => 'icon-fontclass-tuanduifenxiaoshang'
  508. ],
  509. [
  510. 'name' => '商品助手',
  511. 'route' => 'plugin.goods-assistant.admin.import.taobao',
  512. 'is_plugin' => 1,
  513. 'icon' => 'icon-fontclass-mendianshangpin'
  514. ],
  515. [
  516. 'name' => '装修页面',
  517. 'route' => 'plugin.decorate.admin.page.get-list',
  518. 'is_plugin' => 1,
  519. 'param' => [
  520. 'i' => \YunShop::app()->uniacid
  521. ],
  522. 'special_param' => '#/home',
  523. 'icon' => 'icon-energetank_vipcard'
  524. ],
  525. [
  526. 'name' => '设置底部导航',
  527. 'route' => 'plugin.decorate.admin.page.get-list',
  528. 'is_plugin' => 1,
  529. 'param' => [
  530. 'i' => \YunShop::app()->uniacid
  531. ],
  532. 'special_param' => '#/bottom_navigation_list',
  533. 'icon' => 'icon-fontclass-dibudaohang'
  534. ],
  535. [
  536. 'name' => '选择页面模板',
  537. 'route' => 'plugin.decorate.admin.page.get-list',
  538. 'is_plugin' => 1,
  539. 'param' => [
  540. 'i' => \YunShop::app()->uniacid
  541. ],
  542. 'special_param' => '#/diy_template_manage',
  543. 'icon' => 'icon-ht_operation_add'
  544. ],
  545. [
  546. 'name' => '模板市场',
  547. 'route' => 'plugin.decorate.admin.decorate-diy.index',
  548. 'is_plugin' => 1,
  549. 'icon' => 'icon-ht_content_apply'
  550. ],
  551. [
  552. 'name' => '自定义文字',
  553. 'route' => 'setting.lang.index',
  554. 'is_plugin' => 0,
  555. 'icon' => 'icon-ht_textstyle_blod'
  556. ]
  557. ]
  558. ],
  559. [
  560. 'title' => '会员基础功能',
  561. 'list' => [
  562. [
  563. 'name' => '手机验证码登录',
  564. 'route' => 'setting.shop.member',
  565. 'is_plugin' => 0,
  566. 'icon' => 'icon-fontclass-yanzhengma'
  567. ],
  568. [
  569. 'name' => '强制绑定手机号',
  570. 'route' => 'setting.shop.member',
  571. 'is_plugin' => 0,
  572. 'icon' => 'icon-fontclass-shoujihao'
  573. ],
  574. [
  575. 'name' => '会员等级设置',
  576. 'route' => 'setting.shop.member',
  577. 'is_plugin' => 0,
  578. 'icon' => 'icon-huiyuanguanli-copy'
  579. ],
  580. [
  581. 'name' => '邀请码设置',
  582. 'route' => 'setting.shop.member',
  583. 'is_plugin' => 0,
  584. 'icon' => 'icon-fontclass-yaoqingma'
  585. ],
  586. [
  587. 'name' => '会员注册资料',
  588. 'route' => 'setting.form.index',
  589. 'is_plugin' => 0,
  590. 'icon' => 'icon-dingdan1'
  591. ],
  592. [
  593. 'name' => '会员注册协议/页面',
  594. 'route' => 'setting.shop.register',
  595. 'is_plugin' => 0,
  596. 'icon' => 'icon-fontclass-shouyintaidingdan'
  597. ],
  598. [
  599. 'name' => '会员等级管理',
  600. 'route' => 'member.member-level.index',
  601. 'is_plugin' => 0,
  602. 'icon' => 'icon-fontclass-huiyuandengji'
  603. ],
  604. [
  605. 'name' => '关系链设置',
  606. 'route' => 'member.member-relation.index',
  607. 'is_plugin' => 0,
  608. 'icon' => 'icon-all_link'
  609. ],
  610. [
  611. 'name' => '企业微信管理',
  612. 'route' => 'plugin.work-wechat-platform.admin.crop.index',
  613. 'is_plugin' => 1,
  614. 'icon' => 'icon-fontclass-qiyeweix'
  615. ],
  616. [
  617. 'name' => '导入会员',
  618. 'route' => 'plugin.import-members.Backend.Modules.Member.Controllers.page',
  619. 'is_plugin' => 1,
  620. 'icon' => 'icon-fontclass-fenxiangjiang'
  621. ],
  622. [
  623. 'name' => '会员等级同步',
  624. 'route' => 'plugin.level-cogradient.admin.set.index',
  625. 'is_plugin' => 1,
  626. 'icon' => 'icon-fontclass-huiyuantongbu'
  627. ],
  628. [
  629. 'name' => '会员标签',
  630. 'route' => 'plugin.member-tags.Backend.controllers.tag.index',
  631. 'is_plugin' => 1,
  632. 'icon' => 'icon-goods-class'
  633. ],
  634. ]
  635. ],
  636. [
  637. 'title' => '订单与财务',
  638. 'list' => [
  639. [
  640. 'name' => '自动关闭未付款订单',
  641. 'route' => 'setting.shop.trade',
  642. 'is_plugin' => 0,
  643. 'icon' => 'icon-fontclass-wenzhangzhongxin'
  644. ],
  645. [
  646. 'name' => '自动收货',
  647. 'route' => 'setting.shop.trade',
  648. 'is_plugin' => 0,
  649. 'icon' => 'icon-fontclass-shouhuo'
  650. ],
  651. [
  652. 'name' => '交易设置(退款)',
  653. 'route' => 'setting.shop.trade',
  654. 'is_plugin' => 0,
  655. 'icon' => 'icon-fontclass-fanli'
  656. ],
  657. [
  658. 'name' => '发票设置',
  659. 'route' => 'setting.shop.trade',
  660. 'is_plugin' => 0,
  661. 'icon' => 'icon-fontclass-fufeijilu'
  662. ],
  663. [
  664. 'name' => '支付协议',
  665. 'route' => 'setting.shop.trade',
  666. 'is_plugin' => 0,
  667. 'icon' => 'icon-fontclass-shouquanshu'
  668. ],
  669. [
  670. 'name' => '商城电子合同',
  671. 'route' => 'plugin.shop-esign.admin.set.index',
  672. 'is_plugin' => 1,
  673. 'icon' => 'icon-yq_hetongzhongxin'
  674. ],
  675. [
  676. 'name' => '支付密码',
  677. 'route' => 'password.setting.index',
  678. 'is_plugin' => 0,
  679. 'icon' => 'icon-fontclass-mima'
  680. ],
  681. [
  682. 'name' => '批量发货',
  683. 'route' => 'order.batch-send.index',
  684. 'is_plugin' => 0,
  685. 'icon' => 'icon-fontclass-fahuo'
  686. ],
  687. [
  688. 'name' => '快递助手',
  689. 'route' => 'plugin.exhelper.admin.print-once.search',
  690. 'is_plugin' => 1,
  691. 'icon' => 'icon-ht_content_goods'
  692. ],
  693. [
  694. 'name' => '提现设置',
  695. 'route' => 'finance.withdraw-set.see',
  696. 'is_plugin' => 0,
  697. 'icon' => 'icon-fontclass-shezhi2'
  698. ],
  699. [
  700. 'name' => '提现记录',
  701. 'route' => 'withdraw.records',
  702. 'is_plugin' => 0,
  703. 'icon' => 'icon-fontclass-huodongshuoming'
  704. ],
  705. [
  706. 'name' => '批量充值',
  707. 'route' => 'excelRecharge.page.index',
  708. 'is_plugin' => 0,
  709. 'icon' => 'icon-fontclass-yue'
  710. ],
  711. ]
  712. ],
  713. [
  714. 'title' => '常用营销活动',
  715. 'list' => [
  716. [
  717. 'name' => '优惠券',
  718. 'route' => 'coupon.coupon.index',
  719. 'is_plugin' => 0,
  720. 'icon' => 'icon-fontclass-youhuiq'
  721. ],
  722. [
  723. 'name' => '满额减',
  724. 'route' => 'enoughReduce.index.index',
  725. 'is_plugin' => 0,
  726. 'icon' => 'icon-fontclass-huiyuankaquanrukou'
  727. ],
  728. [
  729. 'name' => '满额包邮',
  730. 'route' => 'enoughReduce.index.index',
  731. 'is_plugin' => 0,
  732. 'icon' => 'icon-mane01'
  733. ],
  734. [
  735. 'name' => '余额设置',
  736. 'route' => 'finance.balance-set.see',
  737. 'is_plugin' => 0,
  738. 'icon' => 'icon-fontclass-tichengmingxi'
  739. ],
  740. [
  741. 'name' => '积分设置',
  742. 'route' => 'finance.point-set.index',
  743. 'is_plugin' => 0,
  744. 'icon' => 'icon-fontclass-lanniujifen'
  745. ],
  746. [
  747. 'name' => '推广海报',
  748. 'route' => 'plugin.new-poster.admin.poster.index',
  749. 'is_plugin' => 1,
  750. 'icon' => 'icon-jk_haibao'
  751. ],
  752. [
  753. 'name' => '每日签到',
  754. 'route' => 'plugin.sign.Backend.Modules.Sign.Controllers.sign',
  755. 'is_plugin' => 1,
  756. 'icon' => 'icon-daqia'
  757. ],
  758. [
  759. 'name' => '幸运大抽奖',
  760. 'route' => 'plugin.lucky-draw.admin.controllers.activity.index',
  761. 'is_plugin' => 1,
  762. 'icon' => 'icon-fontclass-choujiang'
  763. ],
  764. [
  765. 'name' => '素材中心',
  766. 'route' => 'plugin.material-center.admin.material.index',
  767. 'is_plugin' => 1,
  768. 'icon' => 'icon-ht_show_formicon'
  769. ],
  770. [
  771. 'name' => '新人奖',
  772. 'route' => 'plugin.new-member-prize.admin.controllers.activity.index',
  773. 'is_plugin' => 1,
  774. 'icon' => 'icon-gudingjiangli'
  775. ],
  776. [
  777. 'name' => '定金阶梯团',
  778. 'route' => 'plugin.deposit-ladder.backend.activity.show',
  779. 'is_plugin' => 1,
  780. 'icon' => 'icon-fontclass-jieti'
  781. ],
  782. [
  783. 'name' => '短视频',
  784. 'route' => 'plugin.video-share.admin.set',
  785. 'is_plugin' => 1,
  786. 'icon' => 'icon-fontclass-ship'
  787. ],
  788. ]
  789. ]
  790. );
  791. return $basic_guidance;
  792. }
  793. }