role_reward_give.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. $role = function()
  3. {
  4. $info = Dever::db('setting/role')->select();
  5. return $info;
  6. };
  7. $value_type = array
  8. (
  9. 1 => '百分比',
  10. 2 => '数值',
  11. );
  12. $is_give = array
  13. (
  14. 1 => '是',
  15. 2 => '否',
  16. );
  17. $prize = function()
  18. {
  19. $info = Dever::db('setting/prize')->select();
  20. return $info;
  21. };
  22. $role_id = Dever::input('search_option_role_id');
  23. $update = false;
  24. $value = '3,4';
  25. if ($role_id) {
  26. $role_info = Dever::db('setting/role')->find($role_id);
  27. if ($role_info && $role_info['type'] == 2 && $role_info['area'] < 3) {
  28. if ($role_info['area'] == 2) {
  29. $value = '4';
  30. }
  31. $update = 'text';
  32. }
  33. }
  34. return array
  35. (
  36. # 表名
  37. 'name' => 'role_reward_give',
  38. # 显示给用户看的名称
  39. 'lang' => '直推额外奖励',
  40. 'menu' => false,
  41. # 数据结构
  42. 'struct' => array
  43. (
  44. 'id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. 'search' => 'order',
  52. 'update' => 'hidden',
  53. //'list' => true,
  54. ),
  55. 'reward_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '角色信息',
  59. 'default' => '',
  60. 'desc' => '奖励id',
  61. 'match' => 'is_numeric',
  62. 'update' => 'hidden',
  63. //'search' => 'hidden',
  64. 'value' => Dever::input('search_option_reward_id'),
  65. 'list' => 'Dever::load("setting/lib/manage.showReward", {reward_id})',
  66. ),
  67. 'num' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '推荐个数-每推荐多少个,就会赠送多少额外奖励',
  71. 'default' => '1',
  72. 'desc' => '推荐个数',
  73. 'match' => 'is_numeric',
  74. 'update' => 'text',
  75. 'list' => true,
  76. ),
  77. 'state' => array
  78. (
  79. 'type' => 'tinyint-1',
  80. 'name' => '状态',
  81. 'default' => '1',
  82. 'desc' => '请选择状态',
  83. 'match' => 'is_numeric',
  84. ),
  85. 'cdate' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '创建时间',
  89. 'match' => array('is_numeric', time()),
  90. 'desc' => '',
  91. # 只有insert时才生效
  92. //'insert' => true,
  93. 'search' => 'date',
  94. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  95. ),
  96. ),
  97. 'manage' => array
  98. (
  99. 'edit' => false,
  100. 'list_button' => array
  101. (
  102. 'fast' => array('编辑', '"role_reward_give&where_id={id}&oper_save_jump=role_reward_give&oper_table=role_reward_give&oper_parent=role_reward_give"'),
  103. 'location1' => array('权益设置', Dever::url('lib/reward_set.home', 'agent')),
  104. )
  105. ),
  106. 'request' => array
  107. (
  108. 'getData' => array
  109. (
  110. # 匹配的正则或函数 选填项
  111. 'option' => array
  112. (
  113. 'reward_id' => 'yes',
  114. 'state' => 1,
  115. ),
  116. 'type' => 'all',
  117. 'order' => array('num' => 'desc', 'cdate' => 'desc'),
  118. 'col' => '*',
  119. ),
  120. ),
  121. );