discount.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. $role = array
  3. (
  4. 1 => '代理商角色',
  5. );
  6. $cate = function()
  7. {
  8. $where['project_id'] = 1;
  9. return Dever::db('category/info')->getTop($where);
  10. };
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'discount',
  15. # 显示给用户看的名称
  16. 'lang' => '角色折扣管理',
  17. 'order' => 90,
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'list' => true,
  29. ),
  30. 'role' => array
  31. (
  32. 'type' => 'int-11',
  33. 'name' => '折扣角色',
  34. 'default' => '1',
  35. 'desc' => '折扣角色',
  36. 'match' => 'is_numeric',
  37. 'update' => 'select',
  38. 'option' => $role,
  39. 'search' => 'radio',
  40. 'list' => true,
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-80',
  45. 'name' => '折扣标题',
  46. 'default' => '',
  47. 'desc' => '标题',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'list' => true,
  51. 'search' => 'fulltext',
  52. ),
  53. 'num' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '折扣数值-直接填写折扣的数值,如填写9,就是9折,如一个角色填写了多个折扣,支付时自动使用最低折扣结算',
  57. 'default' => '9',
  58. 'desc' => '折扣数值',
  59. 'match' => 'is_numeric',
  60. 'update' => 'text',
  61. 'list' => true,
  62. ),
  63. 'category' => array
  64. (
  65. 'type' => 'varchar-500',
  66. 'name' => '可用商品分类-不选择则所有商品可用',
  67. 'default' => '',
  68. 'desc' => '可用商品分类',
  69. 'match' => 'option',
  70. //'search' => 'linkage',
  71. 'update' => 'checkbox',
  72. 'option' => $cate,
  73. //'option' => Dever::url('api.get', 'category'),
  74. //'list' => 'Dever::load("category/api.string", "{category}")',
  75. ),
  76. 'state' => array
  77. (
  78. 'type' => 'tinyint-1',
  79. 'name' => '状态',
  80. 'default' => '1',
  81. 'desc' => '请选择状态',
  82. 'match' => 'is_numeric',
  83. ),
  84. 'cdate' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '录入时间',
  88. 'match' => array('is_numeric', time()),
  89. 'desc' => '',
  90. # 只有insert时才生效
  91. 'insert' => true,
  92. ),
  93. ),
  94. # 默认值
  95. 'default' => array
  96. (
  97. 'col' => 'name,role,num,state,cdate',
  98. 'value' => array
  99. (
  100. '"代理优惠",1,9,1,' . time(),
  101. ),
  102. ),
  103. # 管理功能
  104. 'manage' => array
  105. (
  106. //'insert' => false,
  107. //'edit' => false,
  108. //'delete' => false,
  109. # 列表
  110. 'list_button' => array
  111. (
  112. //'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
  113. 'location' => array('商品设置', Dever::url('lib/goods_set.home', 'act')),
  114. ),
  115. ),
  116. # request 请求接口定义
  117. 'request' => array
  118. (
  119. ),
  120. );