info.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <?php
  2. # 获取分类权限
  3. $status = array
  4. (
  5. 1 => '已认证',
  6. 2 => '认证中',
  7. 3 => '认证失败',
  8. );
  9. $out_template = array
  10. (
  11. 1 => '默认模板',
  12. 2 => '九阳',
  13. 3 => '纯米',
  14. 4 => '安鲜达',
  15. );
  16. $cate = function()
  17. {
  18. $array = array();
  19. $info = Dever::load('category/api')->getTop(1);
  20. if($info)
  21. {
  22. $array += $info;
  23. }
  24. return $array;
  25. };
  26. $stat_type = Dever::db('cash/shop')->config['config_type'];
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'info',
  31. # 显示给用户看的名称
  32. 'lang' => '工厂列表',
  33. # 后台菜单排序
  34. 'order' => 99,
  35. 'out_template' => $out_template,
  36. 'end' => array
  37. (
  38. 'insert' => 'factory/lib/manage.infoUpdate',
  39. 'update' => 'factory/lib/manage.infoUpdate',
  40. ),
  41. # 同步更新另外一个或多个表的多条关联数据,以逗号隔开,goods格式有变化,只能通过end处理
  42. /*
  43. 'sync' => array
  44. (
  45. 'factory/goods' => array
  46. (
  47. # 更新时的条件,另外一个表的字段 => 本表的字段
  48. 'where' => array('factory_id', 'id'),
  49. # 要更新的数据
  50. 'update' => array('goods_id' => 'goods'),
  51. # 同步更新的类型,delete为先删再插入,update为先查询是否存在,存在直接更新,不存在则插入, only为仅更新
  52. 'type' => 'update',
  53. )
  54. ),
  55. */
  56. # 数据结构
  57. 'struct' => array
  58. (
  59. 'id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => 'ID',
  63. 'default' => '',
  64. 'desc' => '',
  65. 'match' => 'is_numeric',
  66. 'search' => 'order',
  67. 'list' => true,
  68. 'order' => 'desc',
  69. ),
  70. 'hr1' => array
  71. (
  72. 'name' => '工厂基本信息',
  73. 'class' => '',//本项必须填写
  74. 'attr' => '',
  75. ),
  76. 'uid' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '用户名',
  80. 'default' => '0',
  81. 'desc' => '请选择用户',
  82. 'match' => 'is_numeric',
  83. //'update' => 'text',
  84. //'search' => 'select',
  85. 'searchs' => array
  86. (
  87. 'api' => 'passport/user-select',
  88. 'col' => 'username',
  89. 'result' => 'id',
  90. ),
  91. //'list' => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
  92. ),
  93. 'name' => array
  94. (
  95. 'type' => 'varchar-32',
  96. 'name' => '工厂名称',
  97. 'default' => '',
  98. 'desc' => '请输入工厂名称',
  99. 'match' => 'is_string',
  100. 'update' => 'text',
  101. 'search' => 'fulltext',
  102. 'list' => true,
  103. ),
  104. 'truename' => array
  105. (
  106. 'type' => 'varchar-100',
  107. 'name' => '联系人姓名',
  108. 'default' => '',
  109. 'desc' => '请输入联系人姓名',
  110. 'match' => 'is_string',
  111. 'update' => 'text',
  112. 'search' => 'fulltext',
  113. 'list' => true,
  114. ),
  115. 'mobile' => array
  116. (
  117. 'type' => 'bigint-11',
  118. 'name' => '联系人电话',
  119. 'default' => '',
  120. 'desc' => '请输入联系人电话',
  121. 'match' => 'is_numeric',
  122. 'update' => 'text',
  123. 'search' => 'fulltext',
  124. 'list' => true,
  125. ),
  126. 'area' => array
  127. (
  128. 'type' => 'varchar-500',
  129. 'name' => '所在城市',
  130. 'default' => '',
  131. 'desc' => '所在城市',
  132. 'match' => 'option',
  133. 'search' => 'linkage',
  134. 'update' => 'linkage',
  135. 'option' => Dever::url('api.get?level_total=3', 'area'),
  136. 'list' => 'Dever::load("area/api.string", "{area}")',
  137. ),
  138. 'province' => array
  139. (
  140. 'type' => 'int-11',
  141. 'name' => '省份',
  142. 'default' => '',
  143. 'desc' => '省份',
  144. 'match' => 'option',
  145. //'update' => 'text',
  146. ),
  147. 'city' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '城市',
  151. 'default' => '',
  152. 'desc' => '城市',
  153. 'match' => 'option',
  154. //'update' => 'text',
  155. ),
  156. 'county' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '县区',
  160. 'default' => '',
  161. 'desc' => '县区',
  162. 'match' => 'option',
  163. //'update' => 'text',
  164. ),
  165. 'map' => array
  166. (
  167. 'type' => 'varchar-300',
  168. 'name' => '地理位置',
  169. 'default' => '',
  170. 'desc' => '地理位置',
  171. 'match' => 'is_string',
  172. # 如果是map,必须在config的base.php中设置map信息
  173. 'update' => 'map',
  174. ),
  175. 'lng' => array
  176. (
  177. 'type' => 'varchar-100',
  178. 'name' => '经度',
  179. 'default' => '',
  180. 'desc' => '经度',
  181. 'match' => 'option',
  182. //'update' => 'text',
  183. //'list' => true,
  184. ),
  185. 'lat' => array
  186. (
  187. 'type' => 'varchar-100',
  188. 'name' => '纬度',
  189. 'default' => '',
  190. 'desc' => '纬度',
  191. 'match' => 'option',
  192. //'update' => 'text',
  193. //'list' => true,
  194. ),
  195. 'address' => array
  196. (
  197. 'type' => 'varchar-1000',
  198. 'name' => '工厂地址',
  199. 'default' => '',
  200. 'desc' => '工厂地址',
  201. 'match' => 'option',
  202. 'update' => 'text',
  203. //'list' => true,
  204. ),
  205. /*
  206. 'goods' => array
  207. (
  208. 'type' => 'text-255',
  209. 'name' => '请输入商品名称-输入商品名称,选择商品',
  210. 'default' => '',
  211. 'desc' => '生产能力',
  212. 'match' => 'option',
  213. 'update' => Dever::input('col') ? 'text' : 'hidden',
  214. //'adding' => 'tag/manage.getByCate?cate=',
  215. # 开启这个,需要将update更换为text类型,输入文字即可选择标签
  216. 'autocomplete' => array('goods/lib/manage.getByName', 'id', 'goods/info-getAllByName'),
  217. //'search' => 'fulltext',
  218. //'list' => true,
  219. # 与上边的cate联动(ajax)
  220. //'show' => 'cate=goods/lib/manage.getByCate?cate=',
  221. # 或者加入可选项
  222. //'option' => $cate,
  223. ),
  224. */
  225. 'goods' => array
  226. (
  227. 'type' => 'text-255',
  228. 'name' => '请先选择分类-选择分类,之后选择分类下的商品,点击商品名称可以设置出厂价,未设置出厂价则认为该工厂无此商品生成能力',
  229. 'default' => '',
  230. 'desc' => '生产能力',
  231. 'match' => 'option',
  232. // 多级联动+多选
  233. 'update' => Dever::input('col') ? 'linkage' : false,
  234. '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=factory&other_id={where_id}&goods_id={id}', 'manage')),
  235. ),
  236. 'hr2' => array
  237. (
  238. 'name' => '工厂认证信息',
  239. 'class' => '',//本项必须填写
  240. 'attr' => '',
  241. ),
  242. 'license' => array
  243. (
  244. 'type' => 'varchar-150',
  245. 'name' => '营业执照',
  246. 'default' => '',
  247. 'desc' => '营业执照',
  248. 'match' => 'option',
  249. 'update' => 'image',
  250. 'key' => '8',
  251. 'place' => '660*660',
  252. ),
  253. 'license_number' => array
  254. (
  255. 'type' => 'varchar-200',
  256. 'name' => '营业执照号码',
  257. 'default' => '',
  258. 'desc' => '营业执照号码',
  259. 'match' => 'option',
  260. 'update' => 'text',
  261. ),
  262. 'company_name' => array
  263. (
  264. 'type' => 'varchar-200',
  265. 'name' => '公司名称',
  266. 'default' => '',
  267. 'desc' => '公司名称',
  268. 'match' => 'option',
  269. 'update' => 'text',
  270. ),
  271. 'idcard_front' => array
  272. (
  273. 'type' => 'varchar-150',
  274. 'name' => '身份证正面',
  275. 'default' => '',
  276. 'desc' => '身份证正面',
  277. 'match' => 'option',
  278. 'update' => 'image',
  279. 'key' => '8',
  280. 'place' => '660*660',
  281. ),
  282. 'idcard_back' => array
  283. (
  284. 'type' => 'varchar-150',
  285. 'name' => '身份证背面',
  286. 'default' => '',
  287. 'desc' => '身份证背面',
  288. 'match' => 'option',
  289. 'update' => 'image',
  290. 'key' => '8',
  291. 'place' => '660*660',
  292. ),
  293. 'kh_license' => array
  294. (
  295. 'type' => 'varchar-150',
  296. 'name' => '开户许可证',
  297. 'default' => '',
  298. 'desc' => '开户许可证',
  299. 'match' => 'option',
  300. 'update' => 'image',
  301. 'key' => '8',
  302. 'place' => '660*660',
  303. ),
  304. 'status' => array
  305. (
  306. 'type' => 'int-11',
  307. 'name' => '认证状态',
  308. 'default' => '1',
  309. 'desc' => '认证状态',
  310. 'match' => 'is_numeric',
  311. 'update' => 'select',
  312. 'option' => $status,
  313. 'search' => 'select',
  314. 'list' => true,
  315. 'edit' => true,
  316. ),
  317. 'stat_type' => array
  318. (
  319. 'type' => 'int-11',
  320. 'name' => '对账周期-可以选择周期生成对账单,选择按天生成对账单,则每天会生成前一天的对账单',
  321. 'default' => '1',
  322. 'desc' => '对账周期',
  323. 'match' => 'is_numeric',
  324. 'update' => 'radio',
  325. 'option' => $stat_type,
  326. 'control' => 'stat_type',
  327. ),
  328. 'stat_day' => array
  329. (
  330. 'type' => 'int-11',
  331. 'name' => '对账单生成日期-这里直接填写对账周期内的第几天即可,如按月对账,这里填写10,就是本月10号生成上一个月的对账单,如按周对账,这里填写2,就是本周二生成上一周的对账单',
  332. 'default' => '10',
  333. 'desc' => '对账单生成日期',
  334. 'match' => 'option',
  335. 'update' => 'text',
  336. 'show' => 'stat_type=1,2',
  337. ),
  338. 'out_template' => array
  339. (
  340. 'type' => 'int-11',
  341. 'name' => '导出模板-供应链管理中导出的表格模板',
  342. 'default' => '1',
  343. 'desc' => '导出模板',
  344. 'match' => 'is_numeric',
  345. 'update' => 'select',
  346. 'option' => $out_template,
  347. 'list' => true,
  348. 'edit' => true,
  349. ),
  350. 'reorder' => array
  351. (
  352. 'type' => 'int-11',
  353. 'name' => '排序(数值越大越靠前)',
  354. 'default' => '1',
  355. 'desc' => '请输入排序',
  356. 'match' => 'option',
  357. //'update' => 'text',
  358. 'search' => 'order',
  359. 'list' => true,
  360. 'order' => 'desc',
  361. 'edit' => true,
  362. ),
  363. 'state' => array
  364. (
  365. 'type' => 'tinyint-1',
  366. 'name' => '状态',
  367. 'default' => '1',
  368. 'desc' => '请选择状态',
  369. 'match' => 'is_numeric',
  370. ),
  371. 'cdate' => array
  372. (
  373. 'type' => 'int-11',
  374. 'name' => '录入时间',
  375. 'match' => array('is_numeric', time()),
  376. 'desc' => '',
  377. # 只有insert时才生效
  378. 'insert' => true,
  379. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  380. ),
  381. ),
  382. 'manage' => array
  383. (
  384. 'list_table' => 'html',
  385. 'list_button' => array
  386. (
  387. 'new' => array('工厂管理', '"home?sign=".Dever::login({id})', 'factory'),
  388. //'add' => array('设置生产能力', '"info&where_id={id}&col=goods&oper_save_jump=info&oper_table=info&oper_parent=info"'),
  389. 'location' => array('设置生产能力', Dever::url('lib/set.home', 'factory')),
  390. 'list3' => array('商品列表', '"goods&search_option_factory_id={id}&oper_table=info"'),
  391. 'list1' => array('账号管理', '"member&search_option_factory_id={id}&oper_table=info"'),
  392. //'list2' => array('订货单', '"order&search_option_factory_id={id}&oper_table=info"'),
  393. ),
  394. ),
  395. 'request' => array
  396. (
  397. 'like' => array
  398. (
  399. # 匹配的正则或函数 选填项
  400. 'option' => array
  401. (
  402. 'name' => array('yes', 'like'),
  403. 'id' => 'yes',
  404. 'status' => 1,
  405. 'state' => 1,
  406. ),
  407. 'type' => 'all',
  408. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  409. 'col' => '*|id',
  410. ),
  411. ),
  412. );