info.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <?php
  2. # 获取分类权限
  3. $status = array
  4. (
  5. 1 => '合作中',
  6. 2 => '已终止合作',
  7. //3 => '申请合作中',
  8. );
  9. $type = array
  10. (
  11. 1 => '体验店',
  12. 2 => '零售店',
  13. 10 => '平台店',
  14. );
  15. $col = 'id,name,`desc`,ps_cash,truename,mobile,lng,lat,address,open,worktime,method,gotime,city,area,province,county,town,coupon_city,pdesc,license,food_license,jy_license,license_number,company_name,coord_address';
  16. $act = function()
  17. {
  18. $info = Dever::db('act/info')->select();
  19. $id = Dever::input('where_id');
  20. $coupon = Dever::db('shop/coupon')->select(array('shop_id' => $id));
  21. if ($coupon) {
  22. foreach ($coupon as $k => $v) {
  23. $coupon_info = Dever::db('goods/coupon')->find($v['coupon_id']);
  24. $prefix = '('.Dever::db('goods/coupon')->config['method'][$coupon_info['method']].')';
  25. $coupon[$k]['name'] = $prefix . $coupon_info['name'];
  26. }
  27. }
  28. foreach ($info as $k => $v) {
  29. if ($v['id'] == 1) {
  30. $info[$k]['child'] = $coupon;
  31. }
  32. }
  33. $info['state'] = 2;//1是无需记录上级id,字符串逗号隔开。2是需要记录上级id,json格式
  34. return $info;
  35. };
  36. $yes = array
  37. (
  38. 1 => '可用',
  39. 2 => '不可用',
  40. );
  41. $open = array
  42. (
  43. 1 => '开启',
  44. 2 => '关闭',
  45. );
  46. $method = array
  47. (
  48. 1 => '自提',
  49. 2 => '外送',
  50. 3 => '以上全支持',
  51. );
  52. $stat_type = Dever::db('cash/shop')->config['config_type'];
  53. return array
  54. (
  55. # 表名
  56. 'name' => 'info',
  57. # 显示给用户看的名称
  58. 'lang' => '门店列表',
  59. # 后台菜单排序
  60. 'order' => 99,
  61. 'act' => $act,
  62. 'config_col' => $col,
  63. 'end' => array
  64. (
  65. 'insert' => 'shop/lib/manage.infoUpdate',
  66. 'update' => 'shop/lib/manage.infoUpdate',
  67. ),
  68. # 数据结构
  69. 'struct' => array
  70. (
  71. 'id' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => 'ID',
  75. 'default' => '',
  76. 'desc' => '',
  77. 'match' => 'is_numeric',
  78. 'search' => 'order',
  79. 'list' => true,
  80. 'order' => 'desc',
  81. ),
  82. 'hr1' => array
  83. (
  84. 'name' => '门店基本信息',
  85. 'class' => '',//本项必须填写
  86. 'attr' => '',
  87. ),
  88. 'uid' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '用户名',
  92. 'default' => '0',
  93. 'desc' => '请选择用户',
  94. 'match' => 'is_numeric',
  95. //'update' => 'text',
  96. //'search' => 'select',
  97. 'searchs' => array
  98. (
  99. 'api' => 'passport/user-select',
  100. 'col' => 'username',
  101. 'result' => 'id',
  102. ),
  103. //'list' => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
  104. ),
  105. 'name' => array
  106. (
  107. 'type' => 'varchar-32',
  108. 'name' => '门店名称',
  109. 'default' => '',
  110. 'desc' => '请输入门店名称',
  111. 'match' => 'is_string',
  112. 'update' => 'text',
  113. 'search' => 'fulltext',
  114. 'list' => true,
  115. ),
  116. 'desc' => array
  117. (
  118. 'type' => 'varchar-800',
  119. 'name' => '门店介绍',
  120. 'default' => '',
  121. 'desc' => '门店介绍',
  122. 'match' => 'is_string',
  123. 'update' => 'textarea',
  124. ),
  125. 'truename' => array
  126. (
  127. 'type' => 'varchar-100',
  128. 'name' => '联系人姓名',
  129. 'default' => '',
  130. 'desc' => '请输入联系人姓名',
  131. 'match' => 'is_string',
  132. 'update' => 'text',
  133. 'search' => 'fulltext',
  134. 'list' => true,
  135. ),
  136. 'mobile' => array
  137. (
  138. 'type' => 'bigint-11',
  139. 'name' => '联系人电话',
  140. 'default' => '',
  141. 'desc' => '请输入联系人电话',
  142. 'match' => Dever::rule('mobile'),
  143. 'update' => 'text',
  144. 'search' => 'fulltext',
  145. 'list' => true,
  146. ),
  147. 'area' => array
  148. (
  149. 'type' => 'varchar-500',
  150. 'name' => '所在街道',
  151. 'default' => '',
  152. 'desc' => '所在街道',
  153. 'match' => 'option',
  154. 'search' => 'linkage',
  155. 'update' => 'linkage',
  156. 'option' => Dever::url('api.get?level_total=4', 'area'),
  157. //'list' => 'Dever::load("area/api.string", "{area}")',
  158. ),
  159. 'province' => array
  160. (
  161. 'type' => 'int-11',
  162. 'name' => '省份',
  163. 'default' => '',
  164. 'desc' => '省份',
  165. 'match' => 'option',
  166. //'update' => 'text',
  167. ),
  168. 'city' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '城市',
  172. 'default' => '',
  173. 'desc' => '城市',
  174. 'match' => 'option',
  175. //'update' => 'text',
  176. ),
  177. 'county' => array
  178. (
  179. 'type' => 'int-11',
  180. 'name' => '县区',
  181. 'default' => '',
  182. 'desc' => '县区',
  183. 'match' => 'option',
  184. //'update' => 'text',
  185. ),
  186. 'town' => array
  187. (
  188. 'type' => 'int-11',
  189. 'name' => '街道',
  190. 'default' => '',
  191. 'desc' => '街道',
  192. 'match' => 'option',
  193. //'update' => 'text',
  194. ),
  195. 'map' => array
  196. (
  197. 'type' => 'varchar-300',
  198. 'name' => '地理位置',
  199. 'default' => '',
  200. 'desc' => '地理位置',
  201. 'match' => 'is_string',
  202. # 如果是map,必须在config的base.php中设置map信息
  203. 'update' => 'map',
  204. ),
  205. 'lng' => array
  206. (
  207. 'type' => 'varchar-100',
  208. 'name' => '经度',
  209. 'default' => '',
  210. 'desc' => '经度',
  211. 'match' => 'option',
  212. //'update' => 'text',
  213. //'list' => true,
  214. ),
  215. 'lat' => array
  216. (
  217. 'type' => 'varchar-100',
  218. 'name' => '纬度',
  219. 'default' => '',
  220. 'desc' => '纬度',
  221. 'match' => 'option',
  222. //'update' => 'text',
  223. //'list' => true,
  224. ),
  225. 'coord_address' => array
  226. (
  227. 'type' => 'varchar-1000',
  228. 'name' => '门店坐标地址',
  229. 'default' => '',
  230. 'desc' => '门店坐标地址',
  231. 'match' => 'option',
  232. //'update' => 'text',
  233. //'list' => true,
  234. ),
  235. 'address' => array
  236. (
  237. 'type' => 'varchar-1000',
  238. 'name' => '门店地址',
  239. 'default' => '',
  240. 'desc' => '门店地址',
  241. 'match' => 'option',
  242. 'update' => 'text',
  243. //'list' => true,
  244. ),
  245. 'goods' => array
  246. (
  247. 'type' => 'text-255',
  248. 'name' => '请先选择分类-选择分类,之后选择分类下的商品,点击商品名称可以设置库存',
  249. 'default' => '',
  250. 'desc' => '生产能力',
  251. 'match' => 'option',
  252. // 多级联动+多选
  253. 'update' => Dever::input('col') ? 'linkage' : false,
  254. 'option' => array(Dever::url('api.get', 'category'), 'cate_id', Dever::url('lib/info.getGoods', 'goods'), '快速设置', Dever::url('project/database/list?project=goods&table=info_sku&page_type=1&other=shop&other_id={where_id}&goods_id={id}', 'manage')),
  255. ),
  256. 'factory' => array
  257. (
  258. 'type' => 'text-255',
  259. 'name' => '分配工厂-请先选择地区,再选择工厂',
  260. 'default' => '',
  261. 'desc' => '分配工厂',
  262. 'match' => 'option',
  263. // 多级联动+多选
  264. 'update' => Dever::input('col') ? 'linkage' : false,
  265. 'option' => array(Dever::url('api.get?level_total=3', 'area'), 'city', Dever::url('lib/manage.getInfo', 'factory'), '分配工厂'),
  266. ),
  267. 'store' => array
  268. (
  269. 'type' => 'text-255',
  270. 'name' => '分配仓库-请先选择地区,再选择仓库',
  271. 'default' => '',
  272. 'desc' => '分配仓库',
  273. 'match' => 'option',
  274. // 多级联动+多选
  275. 'update' => Dever::input('col') ? 'linkage' : false,
  276. 'option' => array(Dever::url('api.get?level_total=3', 'area'), 'city', Dever::url('lib/manage.getInfo', 'store'), '分配仓库'),
  277. ),
  278. 'hr2' => array
  279. (
  280. 'name' => '门店营业设置',
  281. 'class' => '',//本项必须填写
  282. 'attr' => '',
  283. ),
  284. 'open' => array
  285. (
  286. 'type' => 'int-11',
  287. 'name' => '营业状态',
  288. 'default' => '1',
  289. 'desc' => '营业状态',
  290. 'match' => 'is_numeric',
  291. 'update' => 'radio',
  292. 'option' => $open,
  293. 'search' => 'select',
  294. 'list' => true,
  295. ),
  296. 'method' => array
  297. (
  298. 'type' => 'int-11',
  299. 'name' => '门店能力',
  300. 'default' => '3',
  301. 'desc' => '门店能力',
  302. 'match' => 'is_numeric',
  303. 'update' => 'radio',
  304. 'option' => $method,
  305. 'control' => 'method',
  306. ),
  307. 'worktime' => array
  308. (
  309. 'type' => 'varchar-100',
  310. 'name' => '营业时间-如10:00~22:00,24小时制',
  311. 'default' => '',
  312. 'desc' => '营业时间',
  313. 'match' => 'is_string',
  314. 'update' => 'text',
  315. //'show' => 'method=1,3',
  316. ),
  317. 'gotime' => array
  318. (
  319. 'type' => 'varchar-100',
  320. 'name' => '外送时间-如10:00~22:00,24小时制',
  321. 'default' => '',
  322. 'desc' => '外送时间',
  323. 'match' => 'is_string',
  324. //'update' => 'text',
  325. //'show' => 'method=2,3',
  326. ),
  327. 'hr3' => array
  328. (
  329. 'name' => '门店认证信息',
  330. 'class' => '',//本项必须填写
  331. 'attr' => '',
  332. ),
  333. 'license' => array
  334. (
  335. 'type' => 'varchar-150',
  336. 'name' => '营业执照',
  337. 'default' => '',
  338. 'desc' => '营业执照',
  339. 'match' => 'option',
  340. 'update' => 'image',
  341. 'key' => '8',
  342. 'place' => '660*660',
  343. ),
  344. 'license_number' => array
  345. (
  346. 'type' => 'varchar-200',
  347. 'name' => '营业执照号码',
  348. 'default' => '',
  349. 'desc' => '营业执照号码',
  350. 'match' => 'option',
  351. 'update' => 'text',
  352. ),
  353. 'company_name' => array
  354. (
  355. 'type' => 'varchar-200',
  356. 'name' => '公司名称',
  357. 'default' => '',
  358. 'desc' => '公司名称',
  359. 'match' => 'option',
  360. 'update' => 'text',
  361. ),
  362. 'idcard_front' => array
  363. (
  364. 'type' => 'varchar-150',
  365. 'name' => '身份证正面',
  366. 'default' => '',
  367. 'desc' => '身份证正面',
  368. 'match' => 'option',
  369. 'update' => 'image',
  370. 'key' => '8',
  371. 'place' => '660*660',
  372. ),
  373. 'idcard_back' => array
  374. (
  375. 'type' => 'varchar-150',
  376. 'name' => '身份证背面',
  377. 'default' => '',
  378. 'desc' => '身份证背面',
  379. 'match' => 'option',
  380. 'update' => 'image',
  381. 'key' => '8',
  382. 'place' => '660*660',
  383. ),
  384. 'jy_license' => array
  385. (
  386. 'type' => 'varchar-150',
  387. 'name' => '经营许可证',
  388. 'default' => '',
  389. 'desc' => '经营许可证',
  390. 'match' => 'option',
  391. 'update' => 'image',
  392. 'key' => '8',
  393. 'place' => '660*660',
  394. ),
  395. 'food_license' => array
  396. (
  397. 'type' => 'varchar-150',
  398. 'name' => '食品许可证',
  399. 'default' => '',
  400. 'desc' => '食品许可证',
  401. 'match' => 'option',
  402. 'update' => 'image',
  403. 'key' => '8',
  404. 'place' => '660*660',
  405. ),
  406. 'hr4' => array
  407. (
  408. 'name' => '其他设置',
  409. 'class' => '',//本项必须填写
  410. 'attr' => '',
  411. ),
  412. 'type' => array
  413. (
  414. 'type' => 'int-11',
  415. 'name' => '门店类型-自营为平台店,当没有找到加盟店时,将自动获取平台店',
  416. 'default' => '1',
  417. 'desc' => '门店类型',
  418. 'match' => 'is_numeric',
  419. 'update' => 'radio',
  420. 'option' => $type,
  421. 'search' => 'select',
  422. 'list' => true,
  423. ),
  424. 'coupon_city' => array
  425. (
  426. 'type' => 'int-11',
  427. 'name' => '优惠券是否同城可用-废弃',
  428. 'default' => '2',
  429. 'desc' => '优惠券是否同城可用',
  430. 'match' => 'is_numeric',
  431. //'update' => 'radio',
  432. //'update' => Dever::input('col') ? 'radio' : false,
  433. 'option' => $yes,
  434. ),
  435. 'act' => array
  436. (
  437. 'type' => 'text-255',
  438. 'name' => '参与活动',
  439. 'default' => '',
  440. 'desc' => '参与活动',
  441. 'match' => 'option',
  442. 'update' => 'checkbox',
  443. 'update' => Dever::input('col') ? 'checkbox' : false,
  444. 'data' => 'parent',
  445. 'option' => $act,
  446. ),
  447. 'ps_cash' => array
  448. (
  449. 'type' => 'varchar-50',
  450. 'name' => '配送费',
  451. 'default' => '0',
  452. 'desc' => '配送费',
  453. 'match' => 'option',
  454. 'update' => 'text',
  455. ),
  456. 'pdesc' => array
  457. (
  458. 'type' => 'text-255',
  459. 'name' => '配送与自提说明',
  460. 'default' => '',
  461. 'desc' => '配送与自提说明',
  462. 'match' => 'is_string',
  463. 'update' => 'textarea',
  464. ),
  465. 'stat_type' => array
  466. (
  467. 'type' => 'int-11',
  468. 'name' => '对账周期-可以选择按月还是按周生成对账单',
  469. 'default' => '1',
  470. 'desc' => '对账周期',
  471. 'match' => 'is_numeric',
  472. 'update' => 'radio',
  473. 'option' => $stat_type,
  474. ),
  475. 'stat_day' => array
  476. (
  477. 'type' => 'int-11',
  478. 'name' => '对账单生成日期-这里直接填写对账周期内的第几天即可,如按月对账,这里填写10,就是本月10号生成上一个月的对账单,如按周对账,这里填写2,就是本周二生成上一周的对账单',
  479. 'default' => '10',
  480. 'desc' => '对账单生成日期',
  481. 'match' => 'option',
  482. 'update' => 'text',
  483. ),
  484. 'status' => array
  485. (
  486. 'type' => 'int-11',
  487. 'name' => '合作状态',
  488. 'default' => '1',
  489. 'desc' => '合作状态',
  490. 'match' => 'is_numeric',
  491. //'update' => 'select',
  492. 'option' => $status,
  493. 'search' => 'select',
  494. 'list' => true,
  495. 'edit' => true,
  496. ),
  497. 'reorder' => array
  498. (
  499. 'type' => 'int-11',
  500. 'name' => '排序(数值越大越靠前)',
  501. 'default' => '1',
  502. 'desc' => '请输入排序',
  503. 'match' => 'option',
  504. 'update' => 'text',
  505. 'search' => 'order',
  506. //'list' => true,
  507. 'order' => 'desc',
  508. //'edit' => true,
  509. ),
  510. 'state' => array
  511. (
  512. 'type' => 'tinyint-1',
  513. 'name' => '状态',
  514. 'default' => '1',
  515. 'desc' => '请选择状态',
  516. 'match' => 'is_numeric',
  517. ),
  518. 'cdate' => array
  519. (
  520. 'type' => 'int-11',
  521. 'name' => '录入时间',
  522. 'match' => array('is_numeric', time()),
  523. 'desc' => '',
  524. # 只有insert时才生效
  525. 'insert' => true,
  526. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  527. ),
  528. ),
  529. 'manage' => array
  530. (
  531. //'mul' => true,
  532. //'insert' => false,
  533. 'list_button' => array
  534. (
  535. 'delete' => '删除',
  536. 'br11' => array('<br /><br />'),
  537. 'location1' => array('分配工厂', Dever::url('lib/set.factory', 'shop')),
  538. 'location2' => array('分配仓库', Dever::url('lib/set.store', 'shop')),
  539. /*
  540. 'add12' => array('分配工厂', '"info&where_id={id}&col=factory&oper_save_jump=info&oper_table=info&oper_parent=info"'),
  541. 'add13' => array('分配仓库', '"info&where_id={id}&col=store&oper_save_jump=info&oper_table=info&oper_parent=info"'),
  542. */
  543. 'fast' => array('设置活动', '"info&where_id={id}&col=act&oper_save_jump=info&oper_table=info&oper_parent=info"'),
  544. 'br1' => array('<br /><br />'),
  545. 'location' => array('商品设置', Dever::url('lib/set.home', 'shop')),
  546. //'add1' => array('批量设置商品', '"info&where_id={id}&col=goods&oper_save_jump=info&oper_table=info&oper_parent=info"'),
  547. 'list22' => array('商品列表', '"goods&search_option_shop_id={id}&oper_table=info"'),
  548. 'br2' => array('<br /><br />'),
  549. 'list' => array('优惠券管理', '"coupon&search_option_shop_id={id}&oper_table=info"'),
  550. 'list1' => array('账号管理', '"member&search_option_shop_id={id}&oper_table=info"'),
  551. 'list2' => array('打印机管理', '"print&search_option_shop_id={id}&oper_table=info"'),
  552. //'br3' => array('<br /><br />'),
  553. //'list3' => array('销售订单', '"sell_order&search_option_shop_id={id}&oper_table=info"'),
  554. //'list4' => array('采购订单', '"buy_order&search_option_shop_id={id}&oper_table=info"'),
  555. ),
  556. ),
  557. 'request' => array
  558. (
  559. # 获取单条数据
  560. 'getOne' => array
  561. (
  562. # 匹配的正则或函数 选填项
  563. 'option' => array
  564. (
  565. 'city' => 'yes',
  566. 'coupon_city' => 'yes',
  567. 'id' => 'yes',
  568. 'status' => 1,
  569. 'state' => 1,
  570. ),
  571. 'type' => 'one',
  572. 'col' => $col,
  573. ),
  574. ),
  575. );