info.php 17 KB

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