seller.php 13 KB

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