info.php 12 KB

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