seller.php 13 KB

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