info.php 14 KB

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