supplier.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <?php
  2. $type = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('role/supplier_type-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $category = function()
  13. {
  14. $array = array();
  15. $data = Dever::load('product/category-getTop');
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $identity = array
  23. (
  24. 1 => '个人',
  25. 2 => '个体户',
  26. 3 => '企业',
  27. );
  28. return array
  29. (
  30. # 表名
  31. 'name' => 'supplier',
  32. # 显示给用户看的名称
  33. 'lang' => '供应商',
  34. # 是否显示在后台菜单
  35. 'order' => 11,
  36. # 数据结构
  37. 'struct' => array
  38. (
  39. 'id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => 'ID',
  43. 'default' => '',
  44. 'desc' => '',
  45. 'match' => 'is_numeric',
  46. 'list' => true,
  47. 'order' => 'asc',
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-150',
  52. 'name' => '供应商名称',
  53. 'default' => '',
  54. 'desc' => '供应商名称',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. 'edit' => true,
  60. ),
  61. 'type_id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '供应商类型',
  65. 'default' => '1',
  66. 'desc' => '供应商类型',
  67. 'match' => 'is_numeric',
  68. 'update' => 'radio',
  69. 'option' => $type,
  70. ),
  71. 'category' => array
  72. (
  73. 'type' => 'varchar-2000',
  74. 'name' => '商品属性分类-如不选择就是可以销售所有商品属性分类下的商品',
  75. 'default' => '',
  76. 'desc' => '商品属性分类',
  77. 'match' => 'is_string',
  78. 'update' => 'checkbox',
  79. 'option' => $category,
  80. ),
  81. 'truename' => array
  82. (
  83. 'type' => 'varchar-100',
  84. 'name' => '联系人姓名',
  85. 'default' => '',
  86. 'desc' => '请输入联系人姓名',
  87. 'match' => 'is_string',
  88. 'update' => 'text',
  89. 'search' => 'fulltext',
  90. 'tab' => 1,
  91. ),
  92. 'mobile' => array
  93. (
  94. 'type' => 'bigint-11',
  95. 'name' => '联系人电话',
  96. 'default' => '',
  97. 'desc' => '请输入联系人电话',
  98. 'match' => 'is_numeric',
  99. 'update' => 'text',
  100. 'search' => 'fulltext',
  101. 'tab' => 1,
  102. ),
  103. 'area' => array
  104. (
  105. 'type' => 'varchar-500',
  106. 'name' => '联系人城市',
  107. 'default' => '',
  108. 'desc' => '联系人城市',
  109. 'match' => 'option',
  110. 'search' => 'linkage',
  111. 'update' => 'linkage',
  112. 'option' => Dever::url('api.get?level_total=3', 'area'),
  113. //'list' => 'Dever::load("area/api.string", "{area}")',
  114. 'tab' => 1,
  115. ),
  116. 'province' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '省份',
  120. 'default' => '',
  121. 'desc' => '省份',
  122. 'match' => 'option',
  123. //'update' => 'text',
  124. 'tab' => 1,
  125. ),
  126. 'city' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '城市',
  130. 'default' => '',
  131. 'desc' => '城市',
  132. 'match' => 'option',
  133. //'update' => 'text',
  134. 'tab' => 1,
  135. ),
  136. 'county' => array
  137. (
  138. 'type' => 'int-11',
  139. 'name' => '县区',
  140. 'default' => '',
  141. 'desc' => '县区',
  142. 'match' => 'option',
  143. //'update' => 'text',
  144. 'tab' => 1,
  145. ),
  146. 'address' => array
  147. (
  148. 'type' => 'varchar-1000',
  149. 'name' => '联系人地址',
  150. 'default' => '',
  151. 'desc' => '联系人地址',
  152. 'match' => 'option',
  153. 'update' => 'text',
  154. //'list' => true,
  155. 'tab' => 1,
  156. ),
  157. 'identity' => array
  158. (
  159. 'type' => 'tinyint-1',
  160. 'name' => '销售商身份',
  161. 'default' => '1',
  162. 'desc' => '销售商身份',
  163. 'match' => 'is_numeric',
  164. 'update' => 'radio',
  165. 'option' => $identity,
  166. 'control' => 'identity',
  167. 'tab' => 2,
  168. ),
  169. 'idcard_front' => array
  170. (
  171. 'type' => 'varchar-150',
  172. 'name' => '身份证正面-如果是个人,这里上传联系人身份证,如果是个体户或者企业,这里上传法人身份证',
  173. 'default' => '',
  174. 'desc' => '身份证正面',
  175. 'match' => 'option',
  176. 'update' => 'image',
  177. 'key' => '8',
  178. 'place' => '660*660',
  179. 'tab' => 2,
  180. ),
  181. 'idcard_back' => array
  182. (
  183. 'type' => 'varchar-150',
  184. 'name' => '身份证背面-如果是个人,这里上传联系人身份证,如果是个体户或者企业,这里上传法人身份证',
  185. 'default' => '',
  186. 'desc' => '身份证背面',
  187. 'match' => 'option',
  188. 'update' => 'image',
  189. 'key' => '8',
  190. 'place' => '660*660',
  191. 'tab' => 2,
  192. ),
  193. 'company_name' => array
  194. (
  195. 'type' => 'varchar-200',
  196. 'name' => '企业名称',
  197. 'default' => '',
  198. 'desc' => '企业名称',
  199. 'match' => 'option',
  200. 'update' => 'text',
  201. 'show' => 'identity=2,3',
  202. 'tab' => 2,
  203. ),
  204. 'company_license' => array
  205. (
  206. 'type' => 'varchar-150',
  207. 'name' => '企业营业执照',
  208. 'default' => '',
  209. 'desc' => '企业营业执照',
  210. 'match' => 'option',
  211. 'update' => 'image',
  212. 'key' => '8',
  213. 'place' => '660*660',
  214. 'show' => 'identity=2,3',
  215. 'tab' => 2,
  216. ),
  217. 'company_license_number' => array
  218. (
  219. 'type' => 'varchar-200',
  220. 'name' => '企业营业执照号码',
  221. 'default' => '',
  222. 'desc' => '营业执照号码',
  223. 'match' => 'option',
  224. 'update' => 'text',
  225. 'show' => 'identity=2,3',
  226. 'tab' => 2,
  227. ),
  228. 'reorder' => array
  229. (
  230. 'type' => 'int-11',
  231. 'name' => '排序(数值越大越靠前)',
  232. 'default' => '1',
  233. 'desc' => '请输入排序',
  234. 'match' => 'option',
  235. //'update' => 'text',
  236. 'search' => 'order',
  237. 'list_name' => '排序',
  238. 'list' => true,
  239. 'order' => 'desc',
  240. 'edit' => true,
  241. ),
  242. 'state' => array
  243. (
  244. 'type' => 'tinyint-1',
  245. 'name' => '状态',
  246. 'default' => '1',
  247. 'desc' => '请选择状态',
  248. 'match' => 'is_numeric',
  249. ),
  250. 'cdate' => array
  251. (
  252. 'type' => 'int-11',
  253. 'name' => '录入时间',
  254. 'match' => array('is_numeric', time()),
  255. 'desc' => '',
  256. # 只有insert时才生效
  257. 'insert' => true,
  258. //'search' => 'date',
  259. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  260. ),
  261. ),
  262. 'manage' => array
  263. (
  264. 'tab' => array('基本设置', '联系人信息', '认证信息'),
  265. 'button' => array
  266. (
  267. '类型配置' => array('list', 'supplier_type&oper_parent=supplier'),
  268. ),
  269. 'list_button' => array
  270. (
  271. 'location' => array('商品列表', Dever::url('lib/supplier.setGoods', 'role')),
  272. //'fast_add' => array('账户操作', 'push&project=account&oper_table=supplier&oper_project=role&uid={id}'),
  273. )
  274. ),
  275. 'default' => array
  276. (
  277. 'col' => 'name,type_id,state,cdate',
  278. 'value' => array
  279. (
  280. '"默认供应商", 1, 1,' . DEVER_TIME,
  281. ),
  282. ),
  283. 'request' => array
  284. (
  285. )
  286. );