info.php 17 KB

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