info.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <?php
  2. $audit = Dever::config('base')->audit;
  3. $status = Dever::config('base')->status;
  4. $poster_pay_type = array
  5. (
  6. 1 => '未支付',
  7. 2 => '已支付',
  8. );
  9. $config = array
  10. (
  11. # 表名
  12. 'name' => 'info',
  13. # 显示给用户看的名称
  14. 'lang' => '需求列表',
  15. 'order' => 200,
  16. 'auto' => 10000000,
  17. 'end' => array
  18. (
  19. 'insert' => 'demand/lib/manage.demandUpdate',
  20. 'update' => 'demand/lib/manage.demandUpdate',
  21. ),
  22. # 同步更新另外一个或多个表的数据
  23. 'sync' => array
  24. (
  25. 'demand/info_category' => array
  26. (
  27. # 更新另外一个表的字段 => 本表的字段
  28. 'where' => array('info_id', 'id'),
  29. # 要更新的数据
  30. 'update' => array('category_id' => 'category'),
  31. # 同步更新的类型,delete为先删再插入,update为直接更新
  32. 'type' => 'delete',
  33. )
  34. ),
  35. # 数据结构 不同的字段放这里
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. //'list' => true,
  46. ),
  47. 'name' => array
  48. (
  49. 'type' => 'varchar-180',
  50. 'name' => '标题',
  51. 'default' => '',
  52. 'desc' => '标题',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. 'search' => 'fulltext',
  56. //'list' => true,
  57. //'edit' => true,
  58. ),
  59. 'category' => array
  60. (
  61. 'type' => 'varchar-500',
  62. 'name' => '分类',
  63. 'default' => '',
  64. 'desc' => '分类',
  65. 'match' => 'is_string',
  66. 'search' => 'linkage',
  67. 'update' => 'linkage',
  68. 'option' => Dever::url('api.get', 'category'),
  69. //'list' => 'Dever::load("category/api.string", "{category}")',
  70. ),
  71. 'category_id' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '分类ID-最后一个级别的分类,用于分类查询',
  75. 'default' => '-1',
  76. 'desc' => '分类ID',
  77. 'match' => 'is_numeric',
  78. ),
  79. 'pic_cover' => array
  80. (
  81. 'type' => 'varchar-150',
  82. 'name' => '封面图-图片尺寸300*300px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  83. 'default' => '',
  84. 'desc' => '封面图',
  85. 'match' => 'is_string',
  86. 'update' => 'image',
  87. 'key' => '1',
  88. 'place' => '150',
  89. 'list_name' => '需求详情',
  90. 'list' => 'Dever::load("demand/lib/manage.demandInfo", "{id}")',
  91. ),
  92. 'view_price' => array
  93. (
  94. 'type' => 'float-11',
  95. 'name' => '信息服务费-直接填写数字,此处为空则直接使用“需求设置”中的信息服务费,默认为空,如果为负数,则本需求不需要信息服务费,用户可以直接查看信息',
  96. 'default' => '0',
  97. 'desc' => '查看需求价格',
  98. 'match' => 'is_string',
  99. 'update' => 'text',
  100. //'list' => true,
  101. ),
  102. 'num_view' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '阅读数',
  106. 'default' => '0',
  107. 'desc' => '请填写阅读数',
  108. 'match' => 'option',
  109. 'search' => 'order',
  110. 'list' => '{num_view}+{num_add_view}',
  111. ),
  112. 'num_add_view' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '阅读数基数',
  116. 'default' => '0',
  117. 'desc' => '阅读数基数',
  118. 'match' => 'option',
  119. //'update' => 'text',
  120. ),
  121. 'poster_uid' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '创建人名称',
  125. 'default' => '-1',
  126. 'desc' => '创建人名称',
  127. 'match' => 'is_numeric',
  128. //'update' => 'text',
  129. 'search' => array
  130. (
  131. 'api' => 'passport/user-all',
  132. 'col' => 'username',
  133. 'result' => 'id',
  134. ),
  135. ),
  136. 'poster_pay_type' => array
  137. (
  138. 'type' => 'tinyint-1',
  139. 'name' => '创建人是否支付',
  140. 'default' => '1',
  141. 'desc' => '创建人是否支付',
  142. 'match' => 'is_numeric',
  143. //'update' => 'select',
  144. 'option' => $poster_pay_type,
  145. 'search' => 'select',
  146. ),
  147. 'audit' => array
  148. (
  149. 'type' => 'tinyint-1',
  150. 'name' => '审核',
  151. 'default' => '1',
  152. 'desc' => '审核',
  153. 'match' => 'is_numeric',
  154. //'update' => 'select',
  155. 'option' => $audit,
  156. 'search' => 'select',
  157. 'list' => true,
  158. 'edit' => true,
  159. ),
  160. 'status' => array
  161. (
  162. 'type' => 'tinyint-1',
  163. 'name' => '状态',
  164. 'default' => '1',
  165. 'desc' => '状态',
  166. 'match' => 'is_numeric',
  167. //'update' => 'select',
  168. 'option' => $status,
  169. 'search' => 'select',
  170. 'list' => true,
  171. 'edit' => true,
  172. ),
  173. 'admin_editor' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '后台操作人',
  177. 'default' => '1',
  178. 'desc' => '后台操作人',
  179. 'match' => 'is_numeric',
  180. ),
  181. 'reorder' => array
  182. (
  183. 'type' => 'int-11',
  184. 'name' => '排序-数值越大越靠前,相当于置顶',
  185. 'default' => '1',
  186. 'desc' => '请输入排序',
  187. 'match' => 'option',
  188. //'update' => 'text',
  189. 'search' => 'order',
  190. 'list' => true,
  191. 'order' => 'desc',
  192. 'edit' => true,
  193. ),
  194. 'udate' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '更新时间',
  198. 'match' => array('is_numeric', time()),
  199. 'desc' => '',
  200. ),
  201. 'content' => array
  202. (
  203. 'type' => 'text-800',
  204. 'name' => '内容描述',
  205. 'default' => '',
  206. 'desc' => '内容描述',
  207. 'match' => 'is_string',
  208. 'update' => 'editor',
  209. 'key' => '1',
  210. ),
  211. 'state' => array
  212. (
  213. 'type' => 'tinyint-1',
  214. 'name' => '数据状态',
  215. 'default' => '1',
  216. 'desc' => '请选择状态',
  217. 'match' => 'is_numeric',
  218. ),
  219. 'cdate' => array
  220. (
  221. 'type' => 'int-11',
  222. 'name' => '发布时间',
  223. 'match' => array('is_numeric', time()),
  224. 'desc' => '',
  225. # 只有insert时才生效
  226. 'insert' => true,
  227. 'search' => 'date',
  228. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  229. ),
  230. ),
  231. # 管理功能
  232. 'manage' => array
  233. (
  234. //'insert' => false,
  235. //'delete' => false,
  236. 'mul' => true,
  237. # 自定义快捷新增和编辑
  238. 'button' => array
  239. (
  240. '类别管理' => array('list', 'cate&project=demand&search_option_key=cate&search_option_tablename=类别&oper_parent=info&oper_project=demand'),
  241. ),
  242. # 列表
  243. 'list_button' => array
  244. (
  245. 'add1' => array('属性', '"info_attr&project=demand&search_option_info_id={id}&search_option_category={category}&search_option_category_id={category_id}&oper_parent=info&oper_project=demand&where_id={id}&oper_save_jump=info"'),
  246. ),
  247. ),
  248. # request 请求接口定义
  249. 'request' => array
  250. (
  251. 'search' => array
  252. (
  253. # 匹配的正则或函数 选填项
  254. 'option' => array
  255. (
  256. 'ids' => array('yes-id', 'in'),
  257. 'name' => array('yes', 'like'),
  258. 'id' => 'yes',
  259. 'state' => 1,
  260. ),
  261. 'type' => 'all',
  262. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  263. 'limit' => '0,1000',
  264. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  265. ),
  266. 'getAll' => array
  267. (
  268. # 匹配的正则或函数 选填项
  269. 'option' => array
  270. (
  271. 'audit' => 2,
  272. 'cate_id' => 'yes',
  273. 'state' => 1,
  274. ),
  275. 'type' => 'all',
  276. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  277. //'page' => array(10, 'list'),
  278. 'col' => '*',
  279. ),
  280. # 更新浏览量
  281. 'addView' => array
  282. (
  283. 'type' => 'update',
  284. 'where' => array
  285. (
  286. 'id' => 'yes',
  287. ),
  288. 'set' => array
  289. (
  290. 'num_view' => array('1', '+='),
  291. ),
  292. ),
  293. ),
  294. );
  295. return $config;