info.php 13 KB

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