core.php 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963
  1. <?php
  2. defined('IN_IA') or exit ('Access Denied');
  3. class Core extends WeModuleSite
  4. {
  5. public function getMainMenu()//主菜单
  6. {
  7. global $_W, $_GPC;
  8. $type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
  9. $rst=pdo_update('zhtc_system',array('is_ff'=>2),array('uniacid'=>$_W['uniacid']));
  10. $do = $_GPC['do'];
  11. $navemenu = array();
  12. $cur_color = ' style="color:#d9534f;" ';
  13. $account=pdo_get('zhtc_account',array('uid'=>$_W['user']['uid']));
  14. if ($_W['role'] == 'operator') {
  15. if($account['role']==3){
  16. header('location:city.php');
  17. }
  18. if($account['role']==2){
  19. $arr=explode(',',$account['authority']);
  20. foreach ($arr as $key => $value) {
  21. if( $value=='store'){
  22. $sjarr=array(
  23. 0 => $this->createMainMenu('商家列表 ', $do, 'store', ''),
  24. 1 => $this->createMainMenu('商家添加 ', $do, 'storeinfo2', ''),
  25. 2 => $this->createMainMenu('入驻期限', $do, 'in', ''),
  26. 3 => $this->createMainMenu('商家分类', $do, 'storetype', ''),
  27. 4=> $this->createMainMenu('商家设置', $do, 'storecheck', ''),
  28. 5=> $this->createMainMenu('评论管理', $do, 'sjpinglun', ''),
  29. //6=> $this->createMainMenu('升级管理', $do, 'upgrade', '')
  30. );
  31. if($type['is_syqx']==1 and $type['is_sy']==1){
  32. array_push($sjarr, $this->createMainMenu('收银订单', $do, 'dmorder', ''));
  33. }
  34. if($type['is_yhqqx']==1 and $type['is_coupon']==1){
  35. array_push($sjarr, $this->createMainMenu('优惠券', $do, 'coupon', ''));
  36. }
  37. $navemenu[0] = array(
  38. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=store&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-university"></icon> 商家管理</a>',
  39. 'items' => $sjarr
  40. );
  41. }
  42. if( $value=='information'){
  43. $navemenu[1] = array(
  44. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=information&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-comment-o"></icon> 帖子管理</a>',
  45. 'items' => array(
  46. 0 => $this->createMainMenu('帖子列表 ', $do, 'information', ''),
  47. 1=> $this->createMainMenu('分类列表', $do, 'fenlei', ''),
  48. 2 => $this->createMainMenu('添加帖子', $do, 'addinformation', ''),
  49. 3 => $this->createMainMenu('置顶设置', $do, 'top', ''),
  50. 4=> $this->createMainMenu('帖子设置', $do, 'tzcheck', ''),
  51. 5=> $this->createMainMenu('评论管理', $do, 'tzpinglun', '')
  52. )
  53. );
  54. }
  55. if( $value=='carinfo'){
  56. if($type['is_pcfw']==1 and $type['is_pcqx']==1){
  57. $navemenu[2] = array(
  58. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=carinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-car"></icon> 拼车管理</a>',
  59. 'items' => array(
  60. 0 => $this->createMainMenu('拼车列表 ', $do, 'carinfo', ''),
  61. 2=> $this->createMainMenu('审核设置', $do, 'carcheck', ''),
  62. 3=> $this->createMainMenu('标签管理', $do, 'tag', ''),
  63. )
  64. );
  65. }
  66. }
  67. if( $value=='zx'){
  68. $navemenu[3] = array(
  69. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=zx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-book"></icon> 资讯管理</a>',
  70. 'items' => array(
  71. 1 => $this->createMainMenu('资讯管理', $do, 'zx', ''),
  72. 3=> $this->createMainMenu('资讯审核', $do, 'zxcheckmanager', ''),
  73. 0 => $this->createMainMenu('分类管理 ', $do, 'zxtype', ''),
  74. 2=> $this->createMainMenu('审核设置', $do, 'zxcheck', ''),
  75. 4=> $this->createMainMenu('评论管理', $do, 'zxpinglun', ''),
  76. )
  77. );
  78. }
  79. if( $value=='video'){
  80. if($type['is_video']==1 ){
  81. $navemenu[18] = array(
  82. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=video&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
  83. 'items' => array(
  84. 0 => $this->createMainMenu('视频管理 ', $do, 'video', ''),
  85. 1=> $this->createMainMenu('分类管理', $do, 'videotype', ''),
  86. )
  87. );
  88. }
  89. }
  90. if( $value=='yellowstore'){
  91. if($type['is_pageopen']==1 and $type['is_hyqx']==1){
  92. $navemenu[4] = array(
  93. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=yellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>黄页114</a>',
  94. 'items' => array(
  95. 0 => $this->createMainMenu('入驻列表 ', $do, 'yellowstore', ''),
  96. 1=> $this->createMainMenu('分类管理', $do, 'yellowtype', ''),
  97. 2=> $this->createMainMenu('添加入驻', $do, 'addyellowstore', ''),
  98. 3=> $this->createMainMenu('入驻设置', $do, 'yellowset', ''),
  99. 4=> $this->createMainMenu('审核设置', $do, 'yellowcheck', ''),
  100. )
  101. );
  102. }
  103. }
  104. if( $value=='activity'){
  105. if($type['is_hd']==1 and $type['is_hdqx']==1){
  106. $navemenu[20] = array(
  107. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=activity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
  108. 'items' => array(
  109. 0 => $this->createMainMenu('活动管理 ', $do, 'activity', ''),
  110. 1 => $this->createMainMenu('分类管理 ', $do, 'acttype', ''),
  111. 2 => $this->createMainMenu('活动设置 ', $do, 'activityset', ''),
  112. )
  113. );
  114. }
  115. }
  116. if( $value=='ad'){
  117. $navemenu[6] = array(
  118. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=ad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon> 广告管理</a>',
  119. 'items' => array(
  120. 0 => $this->createMainMenu('广告列表 ', $do, 'ad', ''),
  121. 1 => $this->createMainMenu('广告添加', $do, 'addad', ''),
  122. 2 => $this->createMainMenu('公告列表', $do, 'news', ''),
  123. 3=> $this->createMainMenu('公告设置', $do, 'ggset', ''),
  124. 4=> $this->createMainMenu('流量主管理', $do, 'llz', ''),
  125. )
  126. );
  127. }
  128. if( $value=='goods'){
  129. if($type['is_sp']==1 and $type['is_spqx']==1){
  130. $navemenu[7] = array(
  131. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=goods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:#8d8d8d;" class="fa fa-cart-plus"></icon> 商品管理</a>',
  132. 'items' => array(
  133. 0 => $this->createMainMenu('商品列表 ', $do, 'goods', ''),
  134. 3=> $this->createMainMenu('商品设置', $do, 'goodscheck', ''),
  135. 4=> $this->createMainMenu('订单管理 ', $do, 'ddgl', ''),
  136. )
  137. );
  138. }
  139. }
  140. }
  141. }
  142. if($account['role']==1){
  143. $navemenu[13] = array(
  144. 'title' => '<a href="javascript:void(0)" id="yframe-15" class="panel-title wytitle"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 业务菜单</a>',
  145. 'items' => array(
  146. 0 => $this->createMainMenu('账号管理', $do, 'account', 'fa-home')
  147. )
  148. );
  149. }
  150. }elseif($_W['isfounder'] || $_W['role'] == 'manager' || $_W['role'] == 'operator') {
  151. $navemenu[14] = array(
  152. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=index&m=zh_tcwq" class="panel-title wytitle" id="yframe-14"><icon style="color:#8d8d8d;" class="fa fa-newspaper-o"></icon> 数据概况</a>',
  153. 'items' => array(
  154. 0 => $this->createMainMenu('数据展示 ', $do, 'index', ''),
  155. )
  156. );
  157. // $navemenu[24] = array(
  158. // 'title' => '<a href="index.php?c=site&a=entry&op=display&do=zhanghao&m=zh_tcwq" class="panel-title wytitle" id="yframe-24"><icon style="color:#8d8d8d;" class="fa fa-newspaper-o"></icon>账号管理</a>',
  159. // 'items' => array(
  160. // 0 => $this->createMainMenu('账号管理 ', $do, 'zhanghao', ''),
  161. // 1 => $this->createMainMenu('账号添加 ', $do, 'addzhanghao', ''),
  162. // )
  163. // );
  164. $navemenu[17] = array(
  165. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=nav&m=zh_tcwq" class="panel-title wytitle" id="yframe-17"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>导航管理</a>',
  166. 'items' => array(
  167. 0 => $this->createMainMenu('导航管理 ', $do, 'nav', ''),
  168. 1=> $this->createMainMenu('添加导航', $do, 'addnav', ''),
  169. 2=> $this->createMainMenu('版块导航栏', $do, 'plate', ''),
  170. 3=> $this->createMainMenu('底部导航', $do, 'bottom', ''),
  171. )
  172. );
  173. $sjarr=array(
  174. 0 => $this->createMainMenu('商家列表 ', $do, 'store', ''),
  175. 1 => $this->createMainMenu('商家添加 ', $do, 'storeinfo2', ''),
  176. 2 => $this->createMainMenu('入驻期限', $do, 'in', ''),
  177. 3 => $this->createMainMenu('商家分类', $do, 'storetype', ''),
  178. 4=> $this->createMainMenu('商家设置', $do, 'storecheck', ''),
  179. 5=> $this->createMainMenu('评论管理', $do, 'sjpinglun', ''),
  180. //6=> $this->createMainMenu('升级管理', $do, 'upgrade', '')
  181. );
  182. if($type['is_syqx']==1 and $type['is_sy']==1){
  183. array_push($sjarr, $this->createMainMenu('收银订单', $do, 'dmorder', ''));
  184. }
  185. if($type['is_yhqqx']==1 and $type['is_coupon']==1){
  186. array_push($sjarr, $this->createMainMenu('优惠券', $do, 'coupon', ''));
  187. array_push($sjarr, $this->createMainMenu('优惠券分类', $do, 'coupontype', ''));
  188. }
  189. $navemenu[0] = array(
  190. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=store&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-university"></icon> 商家管理</a>',
  191. 'items' => $sjarr
  192. );
  193. $navemenu[1] = array(
  194. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=information&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-comment-o"></icon> 帖子管理</a>',
  195. 'items' => array(
  196. 0 => $this->createMainMenu('帖子列表 ', $do, 'information', ''),
  197. 1=> $this->createMainMenu('分类列表', $do, 'fenlei', ''),
  198. 2 => $this->createMainMenu('添加帖子', $do, 'addinformation', ''),
  199. 3 => $this->createMainMenu('置顶设置', $do, 'top', ''),
  200. // 3 => $this->createMainMenu('信息分类 ', $do, 'type', ''),
  201. // 4 => $this->createMainMenu('二级信息分类 ', $do, 'type2', ''),
  202. 4=> $this->createMainMenu('帖子设置', $do, 'tzcheck', ''),
  203. 5=> $this->createMainMenu('评论管理', $do, 'tzpinglun', '')
  204. )
  205. );
  206. if($type['is_pcfw']==1 and $type['is_pcqx']==1){
  207. $navemenu[2] = array(
  208. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=carinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-car"></icon> 拼车管理</a>',
  209. 'items' => array(
  210. 0 => $this->createMainMenu('拼车列表 ', $do, 'carinfo', ''),
  211. 2=> $this->createMainMenu('审核设置', $do, 'carcheck', ''),
  212. 3=> $this->createMainMenu('标签管理', $do, 'tag', ''),
  213. )
  214. );
  215. }
  216. $navemenu[3] = array(
  217. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=zx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-book"></icon> 资讯管理</a>',
  218. 'items' => array(
  219. 1 => $this->createMainMenu('资讯管理', $do, 'zx', ''),
  220. 3=> $this->createMainMenu('资讯审核', $do, 'zxcheckmanager', ''),
  221. 0 => $this->createMainMenu('分类管理 ', $do, 'zxtype', ''),
  222. 2=> $this->createMainMenu('审核设置', $do, 'zxcheck', ''),
  223. 4=> $this->createMainMenu('评论管理', $do, 'zxpinglun', ''),
  224. )
  225. );
  226. if($type['is_video']==1 ){
  227. $navemenu[18] = array(
  228. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=video&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
  229. 'items' => array(
  230. 0 => $this->createMainMenu('视频管理 ', $do, 'video', ''),
  231. 1=> $this->createMainMenu('分类管理', $do, 'videotype', ''),
  232. )
  233. );
  234. }
  235. if($type['is_pageopen']==1 and $type['is_hyqx']==1){
  236. $navemenu[4] = array(
  237. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=yellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>黄页114</a>',
  238. 'items' => array(
  239. 0 => $this->createMainMenu('入驻列表 ', $do, 'yellowstore', ''),
  240. 1=> $this->createMainMenu('分类管理', $do, 'yellowtype', ''),
  241. 2=> $this->createMainMenu('添加入驻', $do, 'addyellowstore', ''),
  242. 3=> $this->createMainMenu('入驻设置', $do, 'yellowset', ''),
  243. 4=> $this->createMainMenu('审核设置', $do, 'yellowcheck', ''),
  244. )
  245. );
  246. }
  247. if($type['is_hd']==1 and $type['is_hdqx']==1){
  248. $navemenu[20] = array(
  249. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=activity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
  250. 'items' => array(
  251. 0 => $this->createMainMenu('活动管理 ', $do, 'activity', ''),
  252. 1 => $this->createMainMenu('分类管理 ', $do, 'acttype', ''),
  253. 2 => $this->createMainMenu('活动设置 ', $do, 'activityset', ''),
  254. )
  255. );
  256. }
  257. if($type['g_qx']==1 and $type['g_open']==1){
  258. $navemenu[22] = array(
  259. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=grouporder&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon> 拼团管理</a>',
  260. 'items' => array(
  261. 1=> $this->createMainMenu('订单管理 ', $do, 'grouporder', ''),
  262. 2 => $this->createMainMenu('团管理 ', $do, 'group', ''),
  263. 3 => $this->createMainMenu('商品管理', $do, 'groupgoods', ''),
  264. 4 => $this->createMainMenu('分类列表 ', $do, 'grouptype', ''),
  265. )
  266. );
  267. }
  268. if($type['is_xsqg']==1 and $type['is_qgqx']==1){
  269. $navemenu[23] = array(
  270. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=qgorder&m=zh_tcwq" class="panel-title wytitle" id="yframe-23"><icon style="color:#8d8d8d;" class="fa fa-star-half-o"></icon> 限时抢购</a>',
  271. 'items' => array(
  272. 1 => $this->createMainMenu('订单管理', $do, 'qgorder', ''),
  273. 2 => $this->createMainMenu('商品管理', $do, 'qggoodall', ''),
  274. 3 => $this->createMainMenu('分类管理', $do, 'rushtype', ''),
  275. )
  276. );
  277. }
  278. // $navemenu[5] = array(
  279. // 'title' => '<a href="index.php?c=site&a=entry&op=display&do=news&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:#8d8d8d;" class="fa fa-bell"></icon> 公告管理</a>',
  280. // 'items' => array(
  281. // 0 => $this->createMainMenu('公告列表 ', $do, 'news', ''),
  282. // )
  283. // );
  284. // 下面是复制的上面的数据
  285. if($type['is_sp']==1 and $type['is_spqx']==1){
  286. $navemenu[7] = array(
  287. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=goods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:#8d8d8d;" class="fa fa-cart-plus"></icon> 商品管理</a>',
  288. 'items' => array(
  289. 0 => $this->createMainMenu('商品列表 ', $do, 'goods', ''),
  290. 3=> $this->createMainMenu('商品设置', $do, 'goodscheck', ''),
  291. 4=> $this->createMainMenu('订单管理 ', $do, 'ddgl', ''),
  292. )
  293. );
  294. }
  295. if($type['is_jf']==1 and $type['is_jfqx']==1){
  296. $navemenu[8] = array(
  297. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=integral&m=zh_tcwq" class="panel-title wytitle" id="yframe-8"><icon style="color:#8d8d8d;" class="fa fa-star-half-o"></icon> 积分商城</a>',
  298. 'items' => array(
  299. 0 => $this->createMainMenu('签到管理', $do, 'integral', ''),
  300. 2 => $this->createMainMenu('商品列表', $do, 'jfgoods', ''),
  301. 3 => $this->createMainMenu('商品分类', $do, 'jftype', '')
  302. )
  303. );
  304. }
  305. $yxarr=array(
  306. 0 => $this->createMainMenu('营销插件 ', $do, 'ygquan', ''),
  307. 1 => $this->createMainMenu('商家入驻', $do, 'storerz', ''),
  308. 2 => $this->createMainMenu('发帖子', $do, 'tzopen', ''),
  309. );
  310. if($type['is_hyqx']==1){
  311. array_push($yxarr, $this->createMainMenu('黄页114', $do, 'hyopen', ''));
  312. }
  313. if($type['is_pcqx']==1){
  314. array_push($yxarr, $this->createMainMenu('拼车设置', $do, 'caropen', ''));
  315. }
  316. if($type['is_yhqqx']==1){
  317. array_push($yxarr, $this->createMainMenu('优惠券功能', $do, 'couponset', ''));
  318. }
  319. if($type['is_syqx']==1){
  320. array_push($yxarr, $this->createMainMenu('收银功能', $do, 'syset', ''));
  321. }
  322. if($type['is_hdqx']==1){
  323. array_push($yxarr, $this->createMainMenu('活动报名', $do, 'hdset', ''));
  324. }
  325. // if($type['is_hbqx']==1){
  326. // array_push($yxarr, $this->createMainMenu('红包福利', $do, 'hbopen', ''));
  327. // }
  328. if($type['is_hhrqx']==1){
  329. array_push($yxarr, $this->createMainMenu('加入合伙人', $do, 'hhropen', ''));
  330. }
  331. if($type['is_dcsqx']==1){
  332. array_push($yxarr, $this->createMainMenu('开通多城市', $do, 'manycity', ''));
  333. }
  334. if($type['is_jfqx']==1){
  335. array_push($yxarr, $this->createMainMenu('积分功能', $do, 'jfsz', ''));
  336. }
  337. if($type['is_spqx']==1){
  338. array_push($yxarr, $this->createMainMenu('商品功能', $do, 'spsz', ''));
  339. }
  340. if($type['is_qgqx']==1){
  341. array_push($yxarr, $this->createMainMenu('限时抢购', $do, 'qgset', ''));
  342. }
  343. if($type['g_qx']==1){
  344. array_push($yxarr, $this->createMainMenu('拼团功能', $do, 'groupgoodscheck', ''));
  345. }
  346. if($type['is_message']==1){
  347. array_push($yxarr, $this->createMainMenu('消息推送', $do, 'message', ''));
  348. }
  349. $navemenu[9] = array(
  350. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=ygquan&m=zh_tcwq" class="panel-title wytitle" id="yframe-9"><icon style="color:#8d8d8d;" class="fa fa-gift"></icon> 营销设置</a>',
  351. 'items' => $yxarr
  352. );
  353. $navemenu[6] = array(
  354. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=ad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon> 广告管理</a>',
  355. 'items' => array(
  356. 0 => $this->createMainMenu('广告列表 ', $do, 'ad', ''),
  357. 1 => $this->createMainMenu('广告添加', $do, 'addad', ''),
  358. 2 => $this->createMainMenu('公告列表', $do, 'news', ''),
  359. 3=> $this->createMainMenu('公告设置', $do, 'ggset', ''),
  360. 4=> $this->createMainMenu('流量主管理', $do, 'llz', ''),
  361. )
  362. );
  363. $navemenu[16] = array(
  364. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=txlist&m=zh_tcwq" class="panel-title wytitle" id="yframe-16"><icon style="color:#8d8d8d;" class="fa fa-key"></icon> 数据统计</a>',
  365. 'items' => array(
  366. 2 => $this->createMainMenu('提现列表 ', $do, 'txlist', ''),
  367. 3 => $this->createMainMenu('提现设置 ', $do, 'txsz', ''),
  368. // 0 => $this->createMainMenu('红包统计 ', $do, 'hbdata', ''),
  369. 1 => $this->createMainMenu('销售额统计 ', $do, 'xsdata', ''),
  370. )
  371. );
  372. $navemenu[11] = array(
  373. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=user2&m=zh_tcwq" class="panel-title wytitle" id="yframe-11"><icon style="color:#8d8d8d;" class="fa fa-user"></icon> 会员管理</a>',
  374. 'items' => array(
  375. 0 => $this->createMainMenu('会员列表 ', $do, 'user2', ''),
  376. )
  377. );
  378. if($type['is_hhr']==1 and $type['is_hhrqx']==1){
  379. $navemenu[19] = array(
  380. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=fxlist&m=zh_tcwq" class="panel-title wytitle" id="yframe-19"><icon style="color:#8d8d8d;" class="fa fa-users"></icon> 同城合伙人</a>',
  381. 'items' => array(
  382. 0 => $this->createMainMenu('合伙人管理', $do, 'fxlist', ''),
  383. 1 => $this->createMainMenu('合伙人设置', $do, 'fxset', ''),
  384. 2 => $this->createMainMenu('等级设置', $do, 'level', ''),
  385. 3 => $this->createMainMenu('提现申请', $do, 'fxtx', ''),
  386. )
  387. );
  388. }
  389. if($type['many_city']==2 and $type['is_dcsqx']==1){
  390. $navemenu[15] = array(
  391. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=account&m=zh_tcwq" class="panel-title wytitle" id="yframe-15"><icon style="color:#8d8d8d;" class="fa fa-graduation-cap"></icon>多城市管理</a>',
  392. 'items' => array(
  393. 0 => $this->createMainMenu('账号管理 ', $do, 'account', ''),
  394. 1 => $this->createMainMenu('账号添加 ', $do, 'countadd', ''),
  395. 2 => $this->createMainMenu('佣金提现 ', $do, 'yjtx', ''),
  396. 3 => $this->createMainMenu('代理佣金比例设置', $do, 'commission', '')
  397. )
  398. );
  399. }
  400. if($_COOKIE["cz_password"]==$type['cz_password'] || $type['cz_password']==''){
  401. $navemenu[12] = array(
  402. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=settings&m=zh_tcwq" class="panel-title wytitle" id="yframe-12"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 系统设置</a>',
  403. 'items' => array(
  404. 0 => $this->createMainMenu('基本信息 ', $do, 'settings', ''),
  405. 1 => $this->createMainMenu('小程序配置', $do, 'peiz', ''),
  406. 2 => $this->createMainMenu('支付配置', $do, 'pay', ''),
  407. 4 => $this->createMainMenu('短信配置', $do, 'sms', ''),
  408. 5 => $this->createMainMenu('模板消息', $do, 'template', ''),
  409. 6 => $this->createMainMenu('关键词管理 ', $do, 'sensitive', ''),
  410. 8 => $this->createMainMenu('账号管理 ', $do, 'zhanghao', ''),
  411. 9 => $this->createMainMenu('帮助中心', $do, 'help', ''),
  412. )
  413. );
  414. }else{
  415. $navemenu[12] = array(
  416. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=password&m=zh_tcwq" class="panel-title wytitle" id="yframe-12"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 系统设置</a>',
  417. 'items' => array(
  418. 0 => $this->createMainMenu('基本信息 ', $do, 'password', ''),
  419. 1 => $this->createMainMenu('小程序配置', $do, 'password', ''),
  420. 2 => $this->createMainMenu('支付配置', $do, 'password', ''),
  421. 4 => $this->createMainMenu('短信配置', $do, 'password', ''),
  422. 5 => $this->createMainMenu('模板消息', $do, 'password', ''),
  423. 6 => $this->createMainMenu('关键词管理 ', $do, 'password', ''),
  424. 8 => $this->createMainMenu('账号管理 ', $do, 'password', ''),
  425. 9 => $this->createMainMenu('帮助中心', $do, 'password', ''),
  426. )
  427. );
  428. }
  429. if ($_W['role'] == 'founder'){
  430. $navemenu[21] = array(
  431. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=wxapplist&m=zh_tcwq" class="panel-title wytitle" id="yframe-21"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 权限设置</a>',
  432. 'items' => array(
  433. 0 => $this->createMainMenu('小程序列表 ', $do, 'wxapplist', ''),
  434. )
  435. );
  436. }
  437. }
  438. return $navemenu;
  439. }
  440. public function getMainMenu2()
  441. {
  442. global $_W, $_GPC;
  443. $type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
  444. $do = $_GPC['do'];
  445. $navemenu = array();
  446. $cur_color = ' style="color:#d9534f;" ';
  447. if($_W['isfounder'] || $_W['role'] == 'manager' || $_W['role'] == 'operator') {
  448. $navemenu[0] = array(
  449. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=inindex&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-newspaper-o"></icon> 数据概况</a>',
  450. 'items' => array(
  451. 0 => $this->createMainMenu('数据展示', $do, 'inindex', ''),
  452. )
  453. );
  454. $navemenu[9] = array(
  455. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=instore&m=zh_tcwq" class="panel-title wytitle" id="yframe-9"><icon style="color:#8d8d8d;" class="fa fa-university"></icon> 商家管理</a>',
  456. 'items' => array(
  457. 0 => $this->createMainMenu('商家列表 ', $do, 'instore', ''),
  458. 1 => $this->createMainMenu('商家添加 ', $do, 'instoreinfo2', ''),
  459. 3=> $this->createMainMenu('评论管理', $do, 'insjpinglun', ''),
  460. )
  461. );
  462. $navemenu[1] = array(
  463. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=ininformation&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-comment-o"></icon> 帖子管理</a>',
  464. 'items' => array(
  465. 0 => $this->createMainMenu('帖子列表 ', $do, 'ininformation', ''),
  466. 1 => $this->createMainMenu('添加帖子', $do, 'inaddinformation', ''),
  467. 2=> $this->createMainMenu('评论管理', $do, 'intzpinglun', ''),
  468. )
  469. );
  470. if($type['is_pcfw']==1 and $type['is_pcqx']==1){
  471. $navemenu[2] = array(
  472. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=incarinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-car"></icon> 拼车管理</a>',
  473. 'items' => array(
  474. 0 => $this->createMainMenu('拼车列表 ', $do, 'incarinfo', ''),
  475. )
  476. );
  477. }
  478. $navemenu[3] = array(
  479. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=inzx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-book"></icon> 资讯管理</a>',
  480. 'items' => array(
  481. 1 => $this->createMainMenu('资讯管理', $do, 'inzx', ''),
  482. 3=> $this->createMainMenu('资讯审核', $do, 'inzxcheckmanager', ''),
  483. 4=> $this->createMainMenu('评论管理', $do, 'inzxpinglun', ''),
  484. )
  485. );
  486. if($type['is_pageopen']==1 and $type['is_hyqx']==1){
  487. $navemenu[4] = array(
  488. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=inyellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>黄页114</a>',
  489. 'items' => array(
  490. 0=> $this->createMainMenu('入驻列表 ', $do, 'inyellowstore', ''),
  491. 3=> $this->createMainMenu('添加入驻', $do, 'inaddyellowstore', ''),
  492. )
  493. );
  494. }
  495. if($type['is_hd']==1 and $type['is_hdqx']==1){
  496. $navemenu[20] = array(
  497. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=inactivity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
  498. 'items' => array(
  499. 0 => $this->createMainMenu('活动管理 ', $do, 'inactivity', ''),
  500. )
  501. );
  502. }
  503. $navemenu[18] = array(
  504. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=invideo&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
  505. 'items' => array(
  506. 0 => $this->createMainMenu('视频管理 ', $do, 'invideo', ''),
  507. )
  508. );
  509. $navemenu[5] = array(
  510. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=innews&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:#8d8d8d;" class="fa fa-user"></icon> 公告管理</a>',
  511. 'items' => array(
  512. 0 => $this->createMainMenu('公告列表 ', $do, 'innews', ''),
  513. )
  514. );
  515. // 下面是复制的上面的数据
  516. $navemenu[6] = array(
  517. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=inad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon> 广告管理</a>',
  518. 'items' => array(
  519. 0 => $this->createMainMenu('广告列表 ', $do, 'inad', ''),
  520. 1 => $this->createMainMenu('广告添加', $do, 'inaddad', ''),
  521. )
  522. );
  523. if($type['is_sp']==1 and $type['is_spqx']==1){
  524. $navemenu[7] = array(
  525. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=ingoods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:#8d8d8d;" class="fa fa-cart-plus"></icon> 商品管理</a>',
  526. 'items' => array(
  527. 0 => $this->createMainMenu('商品列表 ', $do, 'ingoods', ''),
  528. // 4=> $this->createMainMenu('订单管理 ', $do, 'inddgl', ''),
  529. )
  530. );
  531. }
  532. $navemenu[8] = array(
  533. 'id' => 'nav12',
  534. 'title' => '<a href="index.php?c=site&a=entry&op=display&do=txdetails&m=zh_tcwq" class="panel-title wytitle" id="yframe-8"><icon style="color:#8d8d8d;" class="fa fa-university"></icon> 提现管理</a>',
  535. 'items' => array(
  536. 0 => $this->createMainMenu('提现明细 ', $do, 'txdetails', ''),
  537. 1 => $this->createMainMenu('申请提现 ', $do, 'txapply', '')
  538. )
  539. );
  540. }
  541. return $navemenu;
  542. }
  543. public function getNaveMenu($city, $action)
  544. {
  545. global $_W, $_GPC;
  546. $type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
  547. $do = $_GPC['do'];
  548. $navemenu = array();
  549. $cur_color = '#8d8d8d';
  550. $navemenu[0] = array(
  551. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=start&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 数据概况</a>',
  552. 'items' => array(
  553. 0 => $this->createSubMenu('数据展示', $do, 'start', 'fa-angle-right', $cur_color, $city),
  554. ),
  555. 'icon' => 'fa fa-user-md'
  556. );
  557. $cur_color = '#8d8d8d';
  558. $navemenu[9] = array(
  559. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-9"><icon style="color:#8d8d8d;" class="fa fa-university"></icon> 商家管理</a>',
  560. 'items' => array(
  561. 0 => $this->createSubMenu('商家列表 ', $do, 'dlinstore', 'fa-angle-right', $cur_color, $city),
  562. 1 => $this->createSubMenu('商家添加 ', $do, 'dlinstoreinfo2', 'fa-angle-right', $cur_color, $city),
  563. 3=> $this->createSubMenu('评论管理', $do, 'dlinsjpinglun', 'fa-angle-right', $cur_color, $city),
  564. )
  565. );
  566. $navemenu[1] = array(
  567. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlininformation&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:' . $cur_color . ';" class="fa fa-bars"></icon> 帖子管理</a>',
  568. 'items' => array(
  569. 0 => $this->createSubMenu('帖子列表 ', $do, 'dlininformation', 'fa-angle-right', $cur_color, $city),
  570. 1 => $this->createSubMenu('添加帖子', $do, 'dlinaddinformation', 'fa-angle-right', $cur_color, $city),
  571. 2 => $this->createSubMenu('评论管理', $do, 'dlintzpinglun', 'fa-angle-right', $cur_color, $city),
  572. )
  573. );
  574. $cur_color = '#8d8d8d';
  575. if($type['is_pcfw']==1 and $type['is_pcqx']==1){
  576. $navemenu[2] = array(
  577. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlincarinfo&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:' . $cur_color . ';" class="fa fa-trophy"></icon> 拼车管理</a>',
  578. 'items' => array(
  579. 0 => $this->createSubMenu('拼车列表 ', $do, 'dlincarinfo', 'fa-angle-right', $cur_color, $city),
  580. )
  581. );
  582. }
  583. $cur_color = '#8d8d8d';
  584. $navemenu[3] = array(
  585. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinzx&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:' . $cur_color . ';" class="fa fa-binoculars"></icon> 资讯管理</a>',
  586. 'items' => array(
  587. 0 => $this->createSubMenu('资讯管理', $do, 'dlinzx', 'fa-angle-right', $cur_color, $city),
  588. 1 => $this->createSubMenu('资讯审核', $do, 'dlinzxcheckmanager', 'fa-angle-right', $cur_color, $city),
  589. 5 => $this->createSubMenu('评论管理', $do, 'dlinzxpinglun', 'fa-angle-right', $cur_color, $city),
  590. ),
  591. );
  592. $cur_color = '#8d8d8d';
  593. if($type['is_pageopen']==1 and $type['is_hyqx']==1){
  594. $navemenu[4] = array(
  595. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinyellowstore&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:' . $cur_color . ';" class="fa fa-gift"></icon> 黄页114</a>',
  596. 'items' => array(
  597. 0 => $this->createSubMenu('入驻列表 ', $do, 'dlinyellowstore', 'fa-angle-right', $cur_color, $city),
  598. 1 => $this->createSubMenu('添加入驻', $do, 'dlinaddyellowstore', 'fa-angle-right', $cur_color, $city),
  599. )
  600. );
  601. }
  602. if($type['is_hd']==1 and $type['is_hdqx']==1){
  603. $navemenu[20] = array(
  604. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinactivity&m=zh_tcwq" class="panel-title wytitle" id="yframe-20"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>活动管理</a>',
  605. 'items' => array(
  606. 0 => $this->createSubMenu('活动管理 ', $do, 'dlinactivity', 'fa-angle-right', $cur_color, $city),
  607. )
  608. );
  609. }
  610. $navemenu[18] = array(
  611. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinvideo&m=zh_tcwq" class="panel-title wytitle" id="yframe-18"><icon style="color:#8d8d8d;" class="fa fa-compass"></icon>视频管理</a>',
  612. 'items' => array(
  613. 0 => $this->createSubMenu('视频管理 ', $do, 'dlinvideo', 'fa-angle-right', $cur_color, $city),
  614. )
  615. );
  616. $cur_color = '#8d8d8d';
  617. $navemenu[5] = array(
  618. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinnews&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:' . $cur_color . ';" class="fa fa-key"></icon> 公告管理</a>',
  619. 'items' => array(
  620. 0 => $this->createSubMenu('公告列表 ', $do, 'dlinnews', 'fa-angle-right', $cur_color, $city),
  621. )
  622. );
  623. $cur_color = '#8d8d8d';
  624. $navemenu[6] = array(
  625. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlinad&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:' . $cur_color . ';" class="fa fa-book"></icon> 广告管理</a>',
  626. 'items' => array(
  627. 0 => $this->createSubMenu('管理广告 ', $do, 'dlinad', 'fa-angle-right', $cur_color, $city),
  628. 1 => $this->createSubMenu('广告添加', $do, 'dlinaddad', 'fa-angle-right', $cur_color, $city),
  629. )
  630. );
  631. $cur_color = '#8d8d8d';
  632. if($type['is_sp']==1 and $type['is_spqx']==1){
  633. $navemenu[7] = array(
  634. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dlingoods&m=zh_tcwq" class="panel-title wytitle" id="yframe-7"><icon style="color:' . $cur_color . ';" class="fa fa-cubes"></icon> 商品管理</a>',
  635. 'items' => array(
  636. 0 => $this->createSubMenu('商品列表 ', $do, 'dlingoods', 'fa-angle-right', $cur_color, $city),
  637. )
  638. );
  639. }
  640. $cur_color = '#8d8d8d';
  641. $navemenu[8] = array(
  642. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=dltxdetails&m=zh_tcwq" class="panel-title wytitle" id="yframe-8"><icon style="color:' . $cur_color . ';" class="fa fa-database"></icon> 提现管理</a>',
  643. 'items' => array(
  644. 0 => $this->createSubMenu('提现明细 ', $do, 'dltxdetails', 'fa-angle-right', $cur_color, $city),
  645. 1 => $this->createSubMenu('申请提现 ', $do, 'dltxapply', 'fa-angle-right', $cur_color, $city),
  646. )
  647. );
  648. return $navemenu;
  649. }
  650. public function getNaveMenu2($storeid)
  651. {
  652. global $_W, $_GPC;
  653. $do = $_GPC['do'];
  654. $navemenu = array();
  655. $cur_color = '#8d8d8d';
  656. $type=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
  657. if($_GPC['account_id']){
  658. $role=pdo_get('zhtc_account',array('uid'=>$_GPC['account_id'],'weid'=>$_W['uniacid']));
  659. setcookie('storeid',$role['storeid']);
  660. $storeid=$role['storeid'];
  661. }else{
  662. $storeid=$_COOKIE["storeid"];
  663. }
  664. $store=pdo_get('zhtc_store',array('id'=>$storeid));
  665. $navemenu[0] = array(
  666. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjstatistics&m=zh_tcwq" class="panel-title wytitle" id="yframe-0"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 商家信息</a>',
  667. 'items' => array(
  668. 0 => $this->createSubMenu('数据概况', $do, 'sjstatistics', 'fa-angle-right', $cur_color, $storeid),
  669. 1 => $this->createSubMenu('门店信息', $do, 'sjstoreinfo', 'fa-angle-right', $cur_color, $storeid),
  670. ),
  671. 'icon' => 'fa fa-user-md'
  672. );
  673. $navemenu[2] = array(
  674. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjddgl&m=zh_tcwq" class="panel-title wytitle" id="yframe-2"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 订单管理</a>',
  675. 'items' => array(
  676. 1 => $this->createSubMenu('订单列表 ', $do, 'sjddgl', 'fa-angle-right', $cur_color, $storeid),
  677. ),
  678. 'icon' => 'fa fa-user-md'
  679. );
  680. $cur_color = '#8d8d8d';
  681. if($store['is_shop']==1 AND $type['is_spqx']==1 AND $type['is_sp']==1){
  682. $navemenu[1] = array(
  683. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjgoods&m=zh_tcwq" class="panel-title wytitle" id="yframe-1"><icon style="color:#8d8d8d;" class="fa fa-cog"></icon> 商品管理</a>',
  684. 'items' => array(
  685. 1 => $this->createSubMenu('商品列表 ', $do, 'sjgoods', 'fa-angle-right', $cur_color, $storeid),
  686. 2=> $this->createSubMenu('添加商品', $do, 'sjaddgoods', 'fa-angle-right', $cur_color, $storeid),
  687. ),
  688. 'icon' => 'fa fa-user-md'
  689. );
  690. }
  691. if($store['is_yhq']==1 AND $type['is_coupon']==1 AND $type['is_yhqqx']==1){
  692. $navemenu[3] = array(
  693. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjcoupon&m=zh_tcwq" class="panel-title wytitle" id="yframe-3"><icon style="color:#8d8d8d;" class="fa fa-university"></icon> 优惠券</a>',
  694. 'items' => array(
  695. 0 => $this->createSubMenu('优惠券列表 ', $do, 'sjcoupon', 'fa-angle-right', $cur_color, $storeid),
  696. 1 => $this->createSubMenu('添加优惠券 ', $do, 'sjaddcoupon', 'fa-angle-right', $cur_color, $storeid),
  697. )
  698. );
  699. }
  700. if($type['g_qx']==1 AND $type['g_open']==1 AND $store['is_pt']==1){
  701. $navemenu[4] = array(
  702. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjgrouporder&m=zh_tcwq" class="panel-title wytitle" id="yframe-4"><icon style="color:#8d8d8d;" class="fa fa-life-ring"></icon> 拼团管理</a>',
  703. 'items' => array(
  704. 1=> $this->createSubMenu('订单管理 ', $do, 'sjgrouporder', 'fa-angle-right', $cur_color, $storeid),
  705. 2 => $this->createSubMenu('团管理 ', $do, 'sjgroup', 'fa-angle-right', $cur_color, $storeid),
  706. 3 => $this->createSubMenu('商品管理', $do, 'sjgroupgoods', 'fa-angle-right', $cur_color, $storeid),
  707. 4 => $this->createSubMenu('添加商品', $do, 'sjaddgroupgoods', 'fa-angle-right', $cur_color, $storeid),
  708. )
  709. );
  710. }
  711. if($type['is_xsqg']==1 AND $type['is_qgqx']==1 AND $store['is_qg']==1){
  712. $navemenu[5] = array(
  713. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjqgorder&m=zh_tcwq" class="panel-title wytitle" id="yframe-5"><icon style="color:#8d8d8d;" class="fa fa-star-half-o"></icon> 限时抢购</a>',
  714. 'items' => array(
  715. 1 => $this->createSubMenu('订单管理', $do, 'sjqgorder', 'fa-angle-right', $cur_color, $storeid),
  716. 2 => $this->createSubMenu('商品管理', $do, 'sjqggoodall', 'fa-angle-right', $cur_color, $storeid),
  717. 3 => $this->createSubMenu('添加商品', $do, 'sjaddqggoodall', 'fa-angle-right', $cur_color, $storeid),
  718. )
  719. );
  720. }
  721. $navemenu[6] = array(
  722. 'title' => '<a href="city.php?c=site&a=entry&op=display&do=sjtxlist&m=zh_tcwq" class="panel-title wytitle" id="yframe-6"><icon style="color:' . $cur_color . ';" class="fa fa-database"></icon> 提现管理</a>',
  723. 'items' => array(
  724. 0 => $this->createSubMenu('提现明细 ', $do, 'sjtxlist', 'fa-angle-right', $cur_color, $storeid),
  725. 1 => $this->createSubMenu('申请提现 ', $do, 'sjtxapply', 'fa-angle-right', $cur_color, $storeid),
  726. )
  727. );
  728. return $navemenu;
  729. }
  730. function createWebUrl2($do, $query = array()) {
  731. $query['do'] = $do;
  732. $query['m'] = strtolower($this->modulename);
  733. return $this->wurl('site/entry', $query);
  734. }
  735. function wurl($segment, $params = array()) {
  736. list($controller, $action, $do) = explode('/', $segment);
  737. $url = './city.php?';
  738. if (!empty($controller)) {
  739. $url .= "c={$controller}&";
  740. }
  741. if (!empty($action)) {
  742. $url .= "a={$action}&";
  743. }
  744. if (!empty($do)) {
  745. $url .= "do={$do}&";
  746. }
  747. if (!empty($params)) {
  748. $queryString = http_build_query($params, '', '&');
  749. $url .= $queryString;
  750. }
  751. return $url;
  752. }
  753. function createCoverMenu($title, $method, $op, $icon = "fa-image", $color = '#d9534f')
  754. {
  755. global $_GPC, $_W;
  756. $cur_op = $_GPC['op'];
  757. $color = ' style="color:'.$color.';" ';
  758. return array('title' => $title, 'url' => $op != $cur_op ? $this->createWebUrl($method, array('op' => $op)) : '',
  759. 'active' => $op == $cur_op ? ' active' : '',
  760. 'append' => array(
  761. 'title' => '<i class="fa fa-angle-right"></i>',
  762. )
  763. );
  764. }
  765. function createMainMenu($title, $do, $method, $icon = "fa-image", $color = '')
  766. {
  767. $color = ' style="color:'.$color.';" ';
  768. return array('title' => $title, 'url' => $do != $method ? $this->createWebUrl($method, array('op' => 'display')) : '',
  769. 'active' => $do == $method ? ' active' : '',
  770. 'append' => array(
  771. 'title' => '<i '.$color.' class="fa fa-angle-right"></i>',
  772. )
  773. );
  774. }
  775. function createSubMenu($title, $do, $method, $icon = "fa-image", $color = '#d9534f', $city)
  776. {
  777. $color = ' style="color:'.$color.';" ';
  778. $url = $this->createWebUrl2($method, array('op' => 'display', 'city' => $city));
  779. if ($method == 'stores2') {
  780. $url = $this->createWebUrl2('stores2', array('op' => 'post', 'id' => $storeid, 'city' =>$city));
  781. }
  782. return array('title' => $title, 'url' => $do != $method ? $url : '',
  783. 'active' => $do == $method ? ' active' : '',
  784. 'append' => array(
  785. 'title' => '<i class="fa '.$icon.'"></i>',
  786. )
  787. );
  788. }
  789. public function getStoreById($id)
  790. {
  791. $store = pdo_fetch("SELECT * FROM " . tablename('zhtc_store') . " WHERE id=:id LIMIT 1", array(':id' => $id));
  792. return $store;
  793. }
  794. public function set_tabbar($action, $storeid)
  795. {
  796. $actions_titles = $this->actions_titles;
  797. $html = '<ul class="nav nav-tabs">';
  798. foreach ($actions_titles as $key => $value) {
  799. if ($key == 'stores') {
  800. $url = $this->createWebUrl('stores', array('op' => 'post', 'id' => $storeid));
  801. } else {
  802. $url = $this->createWebUrl($key, array('op' => 'display', 'storeid' => $storeid));
  803. }
  804. $html .= '<li class="' . ($key == $action ? 'active' : '') . '"><a href="' . $url . '">' . $value . '</a></li>';
  805. }
  806. $html .= '</ul>';
  807. return $html;
  808. }
  809. public function getSon($pid ,$arr){
  810. $newarr=array();
  811. foreach ($arr as $key => $value) {
  812. if($pid==$value['type_id']){
  813. $newarr[]=$value;
  814. // continue;
  815. }
  816. }
  817. return $newarr;
  818. }
  819. public function getSon2($pid ,$arr){
  820. $newarr=array();
  821. foreach ($arr as $key => $value) {
  822. if($pid==$value['type2_id']){
  823. $newarr[]=$value;
  824. // continue;
  825. }
  826. }
  827. return $newarr;
  828. }
  829. public function increaseScore($user_id){
  830. global $_GPC, $_W;
  831. $system=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
  832. if($system['is_jf']==1 and $system['integral']>0){
  833. $res= pdo_update('zhtc_user',array('total_score +='=>$system['integral']),array('id'=>$user_id));
  834. if($res){
  835. $data3['score']=$system['integral'];
  836. $data3['user_id']=$user_id;
  837. $data3['note']='发帖';
  838. $data3['type']=1;
  839. $data3['cerated_time']=date('Y-m-d H:i:s');
  840. $data3['uniacid']=$_W['uniacid'];//小程序id
  841. pdo_insert('zhtc_integral',$data3);//添加积分明细
  842. }
  843. }
  844. }
  845. public function getaccess_token(){
  846. global $_GPC, $_W;
  847. $tokenName='access_token'.$_W['uniacid'];
  848. $timeName='access_token_time'.$_W['uniacid'];
  849. load()->classs('wesession');
  850. WeSession::start($_W['uniacid'], CLIENT_IP);
  851. if($_SESSION[$timeName]<time() || !$_SESSION[$tokenName]){
  852. $res=pdo_get('zhtc_system',array('uniacid'=>$_W['uniacid']));
  853. $appid=$res['appid'];
  854. $secret=$res['appsecret'];
  855. $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$secret."";
  856. $ch = curl_init();
  857. curl_setopt($ch, CURLOPT_URL,$url);
  858. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  859. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
  860. $data = curl_exec($ch);
  861. curl_close($ch);
  862. $data = json_decode($data,true);
  863. $_SESSION[$tokenName]=$data['access_token'];
  864. $_SESSION[$timeName]=time()+300;
  865. return $data['access_token'];
  866. }else{
  867. return $_SESSION[$tokenName];
  868. }
  869. }
  870. public function httpRequest($url,$data = null){
  871. $curl = curl_init();
  872. curl_setopt($curl, CURLOPT_URL, $url);
  873. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
  874. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
  875. if (!empty($data)){
  876. curl_setopt($curl, CURLOPT_POST, 1);
  877. curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  878. }
  879. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  880. //执行
  881. $output = curl_exec($curl);
  882. curl_close($curl);
  883. return $output;
  884. }
  885. //查找模板的关键词列表
  886. public function getKeyword($id){
  887. global $_GPC, $_W;
  888. $url='https://api.weixin.qq.com/cgi-bin/wxopen/template/library/get?access_token='.$this->getaccess_token();
  889. $formWork = '{
  890. "id": "' . $id . '"
  891. }';
  892. $data = $this->httpRequest($url, $formWork);
  893. return json_decode($data,true)['keyword_list'];
  894. }
  895. //生成模板
  896. public function generateTemplate($id,$keyword_id_list){
  897. global $_GPC, $_W;
  898. $key=$this->getKeyword($id);
  899. $list=[];
  900. for($i=0;$i<count($keyword_id_list);$i++){
  901. for($k=0;$k<count($key);$k++){
  902. if($keyword_id_list[$i]==$key[$k]['name']){
  903. $list[]=$key[$k]['keyword_id'];
  904. }
  905. }
  906. }
  907. $url='https://api.weixin.qq.com/cgi-bin/wxopen/template/add?access_token='.$this->getaccess_token();
  908. $formWork = '{
  909. "id": "' . $id . '",
  910. "keyword_id_list": ' . json_encode($list) . '
  911. }';
  912. $data = $this->httpRequest($url, $formWork);
  913. // print_r($data);die;
  914. return json_decode($data,true)['template_id'];
  915. }
  916. }