info.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <?php
  2. $type = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('scm_seller/type-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $seller = function()
  13. {
  14. $array = array();
  15. $data = Dever::load('scm_seller/info-state');
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $category = function()
  23. {
  24. $array = array();
  25. $data = Dever::load('scm_product/category-getTop');
  26. if($data)
  27. {
  28. $array += $data;
  29. }
  30. return $array;
  31. };
  32. $price = function()
  33. {
  34. $array = array
  35. (
  36. -1 => '默认模板',
  37. );
  38. $data = Dever::load('scm_product/price-state');
  39. if($data)
  40. {
  41. $array += $data;
  42. }
  43. return $array;
  44. };
  45. $sell_goods = array
  46. (
  47. 1 => '经销所有商品',
  48. 2 => '经销部分商品',
  49. );
  50. $identity = array
  51. (
  52. 1 => '个人',
  53. 2 => '个体户',
  54. 3 => '企业',
  55. );
  56. $stock = array
  57. (
  58. 1 => '独立库存',
  59. 2 => '共享库存',
  60. );
  61. $status = array
  62. (
  63. 1 => '启用',
  64. 2 => '禁用',
  65. );
  66. $account = function() {
  67. return Dever::load('account/api')->getConfig('scm_seller/info');
  68. };
  69. return array
  70. (
  71. # 表名
  72. 'name' => 'seller',
  73. # 显示给用户看的名称
  74. 'lang' => '经销商列表',
  75. # 是否显示在后台菜单
  76. 'order' => 11,
  77. # 数据结构
  78. 'struct' => array
  79. (
  80. 'id' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '经销商ID',
  84. 'default' => '',
  85. 'desc' => '',
  86. 'match' => 'is_numeric',
  87. 'list' => true,
  88. 'order' => 'asc',
  89. ),
  90. 'name' => array
  91. (
  92. 'type' => 'varchar-150',
  93. 'name' => '经销商名称',
  94. 'default' => '',
  95. 'desc' => '经销商名称',
  96. 'match' => 'is_string',
  97. 'update' => 'text',
  98. 'search' => 'fulltext',
  99. 'list' => true,
  100. 'edit' => true,
  101. ),
  102. 'code' => array
  103. (
  104. 'type' => 'varchar-150',
  105. 'name' => '经销商编码',
  106. 'default' => '',
  107. 'desc' => '经销商编码',
  108. 'match' => 'is_string',
  109. 'update' => 'text',
  110. 'search' => 'fulltext',
  111. 'list' => true,
  112. ),
  113. 'info' => array
  114. (
  115. 'type' => 'varchar-800',
  116. 'name' => '经销商介绍',
  117. 'default' => '',
  118. 'desc' => '经销商介绍',
  119. 'match' => 'option',
  120. 'update' => 'textarea',
  121. ),
  122. 'type_id' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '经销商类型',
  126. 'default' => '1',
  127. 'desc' => '经销商类型',
  128. 'match' => 'is_numeric',
  129. 'update' => 'radio',
  130. 'option' => $type,
  131. 'list' => true,
  132. ),
  133. 'account' => array
  134. (
  135. 'type' => 'varchar-800',
  136. 'name' => '选择账户',
  137. 'default' => '',
  138. 'desc' => '选择账户',
  139. 'match' => 'is_string',
  140. 'update' => 'checkbox',
  141. 'option' => $account,
  142. 'list_name' => '账户信息',
  143. 'list' => 'Dever::load("account/api.getInfo", {id}, "{account}")',
  144. ),
  145. 'stock' => array
  146. (
  147. 'type' => 'tinyint-1',
  148. 'name' => '库存设置-如果商品有库存,这里设置库存是否独立或共享,独立库存就是该经销商自己使用一套库存,共享库存就是和其他经销商共享一套库存,共享库存将无法设置商品',
  149. 'default' => '1',
  150. 'desc' => '库存设置',
  151. 'match' => 'is_numeric',
  152. //'update' => 'radio',
  153. 'option' => $stock,
  154. 'control' => 'stock',
  155. ),
  156. 'stock_seller' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '共享经销商-选择和哪个经销商共享一套库存',
  160. 'default' => '-1',
  161. 'desc' => '共享经销商',
  162. 'match' => 'is_numeric',
  163. //'update' => 'select',
  164. 'option' => $seller,
  165. 'show' => 'stock=2'
  166. ),
  167. 'category' => array
  168. (
  169. 'type' => 'varchar-2000',
  170. 'name' => '商品属性分类-如不选择就是可以销售所有商品属性分类下的商品',
  171. 'default' => '',
  172. 'desc' => '商品属性分类',
  173. 'match' => 'is_string',
  174. 'update' => 'checkbox',
  175. 'option' => $category,
  176. 'show' => 'stock=1'
  177. ),
  178. 'price_id' => array
  179. (
  180. 'type' => 'int-11',
  181. 'name' => '商品价格模板',
  182. 'default' => '-1',
  183. 'desc' => '商品价格模板',
  184. 'match' => 'is_numeric',
  185. 'update' => 'select',
  186. 'option' => $price,
  187. 'show' => 'stock=1'
  188. ),
  189. 'commission' => array
  190. (
  191. 'type' => 'varchar-20',
  192. 'name' => '销售佣金调整-针对每个商品的销售佣金做统一调整,如填写5%,就是在原有销售佣金的基础上增加5%佣金,不设置则不做任何调整,设置为0,则佣金为0',
  193. 'default' => '0',
  194. 'desc' => '销售佣金调整',
  195. 'match' => 'option',
  196. 'update' => 'text',
  197. ),
  198. 'truename' => array
  199. (
  200. 'type' => 'varchar-100',
  201. 'name' => '联系人姓名',
  202. 'default' => '',
  203. 'desc' => '请输入联系人姓名',
  204. 'match' => 'is_string',
  205. 'update' => 'text',
  206. 'search' => 'fulltext',
  207. 'tab' => 1,
  208. ),
  209. 'mobile' => array
  210. (
  211. 'type' => 'bigint-11',
  212. 'name' => '联系人电话',
  213. 'default' => '',
  214. 'desc' => '请输入联系人电话',
  215. 'match' => 'is_numeric',
  216. 'update' => 'text',
  217. 'search' => 'fulltext',
  218. 'tab' => 1,
  219. ),
  220. 'area' => array
  221. (
  222. 'type' => 'varchar-500',
  223. 'name' => '联系人城市',
  224. 'default' => '',
  225. 'desc' => '联系人城市',
  226. 'match' => 'option',
  227. 'search' => 'linkage',
  228. 'update' => 'linkage',
  229. 'option' => Dever::url('api.get?level_total=3', 'area'),
  230. //'list' => 'Dever::load("area/api.string", "{area}")',
  231. 'tab' => 1,
  232. ),
  233. 'province' => array
  234. (
  235. 'type' => 'int-11',
  236. 'name' => '省份',
  237. 'default' => '',
  238. 'desc' => '省份',
  239. 'match' => 'option',
  240. //'update' => 'text',
  241. 'tab' => 1,
  242. ),
  243. 'city' => array
  244. (
  245. 'type' => 'int-11',
  246. 'name' => '城市',
  247. 'default' => '',
  248. 'desc' => '城市',
  249. 'match' => 'option',
  250. //'update' => 'text',
  251. 'tab' => 1,
  252. ),
  253. 'county' => array
  254. (
  255. 'type' => 'int-11',
  256. 'name' => '县区',
  257. 'default' => '',
  258. 'desc' => '县区',
  259. 'match' => 'option',
  260. //'update' => 'text',
  261. 'tab' => 1,
  262. ),
  263. 'address' => array
  264. (
  265. 'type' => 'varchar-1000',
  266. 'name' => '联系人地址',
  267. 'default' => '',
  268. 'desc' => '联系人地址',
  269. 'match' => 'option',
  270. 'update' => 'text',
  271. //'list' => true,
  272. 'tab' => 1,
  273. ),
  274. 'identity' => array
  275. (
  276. 'type' => 'tinyint-1',
  277. 'name' => '经销商身份',
  278. 'default' => '1',
  279. 'desc' => '经销商身份',
  280. 'match' => 'is_numeric',
  281. 'update' => 'radio',
  282. 'option' => $identity,
  283. 'control' => 'identity',
  284. 'tab' => 2,
  285. ),
  286. 'idcard_front' => array
  287. (
  288. 'type' => 'varchar-150',
  289. 'name' => '身份证正面-如果是个人,这里上传联系人身份证,如果是个体户或者企业,这里上传法人身份证',
  290. 'default' => '',
  291. 'desc' => '身份证正面',
  292. 'match' => 'option',
  293. 'update' => 'image',
  294. 'key' => '8',
  295. 'place' => '660*660',
  296. 'tab' => 2,
  297. ),
  298. 'idcard_back' => array
  299. (
  300. 'type' => 'varchar-150',
  301. 'name' => '身份证背面-如果是个人,这里上传联系人身份证,如果是个体户或者企业,这里上传法人身份证',
  302. 'default' => '',
  303. 'desc' => '身份证背面',
  304. 'match' => 'option',
  305. 'update' => 'image',
  306. 'key' => '8',
  307. 'place' => '660*660',
  308. 'tab' => 2,
  309. ),
  310. 'company_name' => array
  311. (
  312. 'type' => 'varchar-200',
  313. 'name' => '企业名称',
  314. 'default' => '',
  315. 'desc' => '企业名称',
  316. 'match' => 'option',
  317. 'update' => 'text',
  318. 'show' => 'identity=2,3',
  319. 'tab' => 2,
  320. ),
  321. 'company_license' => array
  322. (
  323. 'type' => 'varchar-150',
  324. 'name' => '企业营业执照',
  325. 'default' => '',
  326. 'desc' => '企业营业执照',
  327. 'match' => 'option',
  328. 'update' => 'image',
  329. 'key' => '8',
  330. 'place' => '660*660',
  331. 'show' => 'identity=2,3',
  332. 'tab' => 2,
  333. ),
  334. 'company_license_number' => array
  335. (
  336. 'type' => 'varchar-200',
  337. 'name' => '企业营业执照号码',
  338. 'default' => '',
  339. 'desc' => '营业执照号码',
  340. 'match' => 'option',
  341. 'update' => 'text',
  342. 'show' => 'identity=2,3',
  343. 'tab' => 2,
  344. ),
  345. 'reorder' => array
  346. (
  347. 'type' => 'int-11',
  348. 'name' => '排序(数值越大越靠前)',
  349. 'default' => '1',
  350. 'desc' => '请输入排序',
  351. 'match' => 'option',
  352. //'update' => 'text',
  353. 'search' => 'order',
  354. 'list_name' => '排序',
  355. 'list' => true,
  356. 'order' => 'desc',
  357. 'edit' => true,
  358. ),
  359. 'status' => array
  360. (
  361. 'type' => 'int-11',
  362. 'name' => '状态',
  363. 'default' => '1',
  364. 'desc' => '状态',
  365. 'match' => 'is_numeric',
  366. //'update' => 'select',
  367. 'option' => $status,
  368. 'search' => 'select',
  369. 'list' => true,
  370. 'edit' => true,
  371. ),
  372. 'state' => array
  373. (
  374. 'type' => 'tinyint-1',
  375. 'name' => '状态',
  376. 'default' => '1',
  377. 'desc' => '请选择状态',
  378. 'match' => 'is_numeric',
  379. ),
  380. 'cdate' => array
  381. (
  382. 'type' => 'int-11',
  383. 'name' => '录入时间',
  384. 'match' => array('is_numeric', time()),
  385. 'desc' => '',
  386. # 只有insert时才生效
  387. 'insert' => true,
  388. //'search' => 'date',
  389. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  390. ),
  391. ),
  392. 'manage' => array
  393. (
  394. 'delete' => false,
  395. 'tab' => array('基本设置', '联系人信息', '认证信息'),
  396. 'button' => array
  397. (
  398. //'类型配置' => array('list', 'type&oper_parent=seller'),
  399. ),
  400. 'list_button' => array
  401. (
  402. 'location' => array('商品设置', Dever::url('lib/set.home?role=seller', 'scm_product'), '{stock} == 1'),
  403. 'br3' => array('<br />'),
  404. 'location2' => array('入库下单', Dever::url('lib/seller.buyGoods', 'scm_role'), '{stock} == 1'),
  405. 'location3' => array('出库下单', Dever::url('lib/seller.buyGoods', 'scm_role'), '{stock} == 1'),
  406. 'location1' => array('订货下单', Dever::url('lib/seller.buyGoods', 'scm_role'), '{stock} == 1'),
  407. 'location4' => array('代客下单', Dever::url('lib/seller.buyGoods', 'scm_role'), '{stock} == 1'),
  408. 'br4' => array('<br />'),
  409. 'fast_add' => array('账户操作', 'push&project=account&oper_table=info&oper_project=scm_seller&uid={id}', '{account}'),
  410. 'list' => array('账户流水', 'info_log&project=account&oper_table=info&oper_project=scm_seller&search_option_uid={id}', '{account}'),
  411. )
  412. ),
  413. 'default' => array
  414. (
  415. 'col' => 'name,code,type_id,state,cdate',
  416. 'value' => array
  417. (
  418. '"平台经销商", "platform", 1, 1,' . DEVER_TIME,
  419. ),
  420. ),
  421. 'request' => array
  422. (
  423. 'like' => array
  424. (
  425. # 匹配的正则或函数 选填项
  426. 'option' => array
  427. (
  428. 'name' => array('yes', 'like'),
  429. 'id' => 'yes',
  430. 'status' => 1,
  431. 'state' => 1,
  432. ),
  433. 'type' => 'all',
  434. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  435. 'col' => '*|id',
  436. ),
  437. )
  438. );