user_share.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. $status = array
  3. (
  4. 1 => '分享中',
  5. 2 => '已分享',
  6. );
  7. $act = function()
  8. {
  9. $array = array();
  10. $info = Dever::db('act/info')->select();
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'user_share',
  21. # 显示给用户看的名称
  22. 'lang' => '用户活动分享',
  23. 'menu' => false,
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'search' => 'order',
  35. 'update' => 'hidden',
  36. //'list' => true,
  37. ),
  38. 'uid' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => '用户名',
  42. 'default' => '0',
  43. 'desc' => '请选择用户',
  44. 'match' => 'is_numeric',
  45. 'update' => 'text',
  46. //'search' => 'select',
  47. 'search' => array
  48. (
  49. 'api' => 'passport/user-all',
  50. 'col' => 'username',
  51. 'result' => 'id',
  52. ),
  53. 'list' => '{uid} > 0 ? Dever::load("passport/user-find#username", {uid}) : "匿名用户"',
  54. ),
  55. 'shop_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '所属门店',
  59. 'default' => '',
  60. 'desc' => '所属门店',
  61. 'match' => 'is_numeric',
  62. 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
  63. ),
  64. 'act_id' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '活动id',
  68. 'default' => '',
  69. 'desc' => '活动id',
  70. 'match' => 'is_numeric',
  71. 'list' => 'Dever::load("act/info-find#name", {act_id})',
  72. ),
  73. 'path' => array
  74. (
  75. 'type' => 'varchar-100',
  76. 'name' => '分享路径',
  77. 'default' => '',
  78. 'desc' => '分享路径',
  79. 'match' => 'option',
  80. //'update' => 'text',
  81. ),
  82. 'status' => array
  83. (
  84. 'type' => 'int-11',
  85. 'name' => '分享状态',
  86. 'default' => '1',
  87. 'desc' => '分享状态',
  88. 'match' => 'is_numeric',
  89. //'update' => 'select',
  90. 'option' => $status,
  91. 'search' => 'select',
  92. 'list' => true,
  93. 'edit' => true,
  94. ),
  95. 'edate' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '失效时间',
  99. 'match' => 'is_numeric',
  100. 'desc' => '',
  101. 'list' => 'date("Y-m-d H:i:s", {edate})',
  102. ),
  103. 'state' => array
  104. (
  105. 'type' => 'tinyint-1',
  106. 'name' => '状态',
  107. 'default' => '1',
  108. 'desc' => '请选择状态',
  109. 'match' => 'is_numeric',
  110. ),
  111. 'cdate' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '领取时间',
  115. 'match' => array('is_numeric', time()),
  116. 'desc' => '',
  117. # 只有insert时才生效
  118. //'insert' => true,
  119. 'search' => 'date',
  120. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  121. ),
  122. ),
  123. 'manage' => array
  124. (
  125. ),
  126. 'request' => array
  127. (
  128. ),
  129. );