xuniren.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <?php
  2. $status = array
  3. (
  4. 1 => '已登场',
  5. 2 => '未登场',
  6. );
  7. $top = array
  8. (
  9. 1 => '不推荐',
  10. 2 => '首页推荐',
  11. );
  12. $sex = array
  13. (
  14. 1 => '男',
  15. 2 => '女',
  16. 3 => '不详',
  17. );
  18. $creater = function()
  19. {
  20. $array = array();
  21. $info = Dever::db('content/creater')->state();
  22. if($info)
  23. {
  24. $array += $info;
  25. }
  26. return $array;
  27. };
  28. return array
  29. (
  30. # 表名
  31. 'name' => 'xuniren',
  32. # 显示给用户看的名称
  33. 'lang' => '虚拟人管理',
  34. 'order' => 99,
  35. 'end' => array
  36. (
  37. //'insert' => 'collection/lib/content.updateTypeId',
  38. //'update' => 'collection/lib/content.updateTypeId',
  39. ),
  40. # 数据结构
  41. 'struct' => array
  42. (
  43. 'id' => array
  44. (
  45. 'type' => 'int-11',
  46. 'name' => 'ID',
  47. 'default' => '',
  48. 'desc' => '',
  49. 'match' => 'is_numeric',
  50. 'list' => true,
  51. ),
  52. 'name' => array
  53. (
  54. 'type' => 'varchar-80',
  55. 'name' => '名称',
  56. 'default' => '',
  57. 'desc' => '名称',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. 'list' => true,
  61. 'search' => 'fulltext',
  62. ),
  63. 'ename' => array
  64. (
  65. 'type' => 'varchar-30',
  66. 'name' => '英文名称',
  67. 'default' => '',
  68. 'desc' => '英文名称',
  69. 'match' => 'is_string',
  70. 'update' => 'text',
  71. 'list' => true,
  72. 'search' => 'fulltext',
  73. ),
  74. 'pic' => array
  75. (
  76. 'type' => 'text-255',
  77. 'name' => '形象大图-可以上传多张,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  78. 'default' => '',
  79. 'desc' => '形象大图',
  80. 'match' => 'option',
  81. 'update' => 'images',
  82. 'key' => '1',
  83. 'place' => '1242*1863',
  84. ),
  85. 'sex' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '性别',
  89. 'default' => '1',
  90. 'desc' => '性别',
  91. 'match' => 'is_numeric',
  92. 'update' => 'select',
  93. 'option' => $sex,
  94. 'search' => 'select',
  95. 'list' => true,
  96. ),
  97. 'birth' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '出生日期-将根据出生日期计算年龄,为空则展示不详',
  101. 'default' => '',
  102. 'desc' => '出生日期',
  103. 'match' => 'is_numeric',
  104. 'update' => 'date',
  105. 'list' => true,
  106. ),
  107. 'city' => array
  108. (
  109. 'type' => 'varchar-500',
  110. 'name' => '诞生地',
  111. 'default' => '',
  112. 'desc' => '诞生地',
  113. 'match' => 'is_string',
  114. 'update' => 'text',
  115. ),
  116. 'creater_id' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '造物主',
  120. 'default' => '-1',
  121. 'desc' => '造物主',
  122. 'match' => 'is_numeric',
  123. 'update' => 'select',
  124. 'option' => $creater,
  125. 'search' => 'select',
  126. ),
  127. 'waimao' => array
  128. (
  129. 'type' => 'varchar-500',
  130. 'name' => '外貌特征',
  131. 'default' => '',
  132. 'desc' => '外貌特征',
  133. 'match' => 'is_string',
  134. 'update' => 'textarea',
  135. ),
  136. 'aihao' => array
  137. (
  138. 'type' => 'varchar-500',
  139. 'name' => '爱好特长/职业',
  140. 'default' => '',
  141. 'desc' => '爱好特长/职业',
  142. 'match' => 'is_string',
  143. 'update' => 'textarea',
  144. ),
  145. 'info' => array
  146. (
  147. 'type' => 'varchar-500',
  148. 'name' => '简介',
  149. 'default' => '',
  150. 'desc' => '简介',
  151. 'match' => 'is_string',
  152. 'update' => 'textarea',
  153. ),
  154. 'news' => array
  155. (
  156. 'type' => 'text-1000',
  157. 'name' => '关联资讯',
  158. 'default' => '',
  159. 'desc' => '关联资讯',
  160. 'match' => 'is_string',
  161. 'update' => array
  162. (
  163. array
  164. (
  165. 'col' => 'name',
  166. 'name' => '资讯标题',
  167. 'default' => '',
  168. 'desc' => '资讯标题',
  169. 'match' => 'is_string',
  170. 'update' => 'text',
  171. ),
  172. array
  173. (
  174. 'col' => 'link',
  175. 'name' => '资讯链接',
  176. 'default' => '',
  177. 'desc' => '资讯链接',
  178. 'match' => 'is_string',
  179. 'update' => 'textarea',
  180. ),
  181. ),
  182. ),
  183. 'pdate' => array
  184. (
  185. 'type' => 'int-11',
  186. 'name' => '初登场时间',
  187. 'match' => array('is_numeric', time()),
  188. 'default' => '',
  189. 'desc' => '',
  190. 'update' => 'date',
  191. 'callback' => 'maketime',
  192. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  193. ),
  194. 'share_title' => array
  195. (
  196. 'type' => 'varchar-100',
  197. 'name' => '分享标题',
  198. 'default' => '',
  199. 'desc' => '分享标题',
  200. 'match' => 'option',
  201. 'update' => 'text',
  202. ),
  203. 'share_pic' => array
  204. (
  205. 'type' => 'varchar-150',
  206. 'name' => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  207. 'default' => '',
  208. 'desc' => '分享图片',
  209. 'match' => 'option',
  210. 'update' => 'image',
  211. 'key' => '1',
  212. 'place' => '150',
  213. //'upload' => 'qiniu',
  214. //'large' => true,
  215. ),
  216. 'share_content' => array
  217. (
  218. 'type' => 'varchar-200',
  219. 'name' => '分享内容',
  220. 'default' => '',
  221. 'desc' => '分享内容',
  222. 'match' => 'option',
  223. 'update' => 'textarea',
  224. ),
  225. 'beizhu' => array
  226. (
  227. 'type' => 'varchar-500',
  228. 'name' => '备注',
  229. 'default' => '',
  230. 'desc' => '备注',
  231. 'match' => 'option',
  232. 'update' => 'textarea',
  233. ),
  234. 'reorder' => array
  235. (
  236. 'type' => 'int-11',
  237. 'name' => '排序(数值越大越靠前)',
  238. 'default' => '1',
  239. 'desc' => '请输入排序',
  240. 'match' => 'option',
  241. //'update' => 'text',
  242. 'search' => 'order',
  243. 'list' => true,
  244. 'order' => 'desc',
  245. 'edit' => true,
  246. ),
  247. 'top' => array
  248. (
  249. 'type' => 'int-11',
  250. 'name' => '是否推荐到首页',
  251. 'default' => '1',
  252. 'desc' => '是否推荐到首页',
  253. 'match' => 'is_numeric',
  254. 'update' => 'select',
  255. 'option' => $top,
  256. 'search' => 'select',
  257. 'list' => true,
  258. 'edit' => true,
  259. ),
  260. 'status' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '登场状态',
  264. 'default' => '1',
  265. 'desc' => '登场状态',
  266. 'match' => 'is_numeric',
  267. 'update' => 'select',
  268. 'option' => $status,
  269. 'search' => 'select',
  270. 'list' => true,
  271. 'edit' => true,
  272. ),
  273. 'state' => array
  274. (
  275. 'type' => 'tinyint-1',
  276. 'name' => '状态',
  277. 'default' => '1',
  278. 'desc' => '请选择状态',
  279. 'match' => 'is_numeric',
  280. ),
  281. 'cdate' => array
  282. (
  283. 'type' => 'int-11',
  284. 'name' => '创建时间',
  285. 'match' => array('is_numeric', time()),
  286. 'desc' => '',
  287. # 只有insert时才生效
  288. 'insert' => true,
  289. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  290. 'search' => 'date',
  291. ),
  292. ),
  293. # 管理功能
  294. 'manage' => array
  295. (
  296. ),
  297. # request 请求接口定义
  298. 'request' => array
  299. (
  300. 'search' => array
  301. (
  302. # 匹配的正则或函数 选填项
  303. 'option' => array
  304. (
  305. 'ids' => array('yes-id', 'in'),
  306. 'name' => array('yes', 'like'),
  307. 'id' => 'yes',
  308. 'status' => 1,
  309. 'state' => 1,
  310. ),
  311. 'type' => 'all',
  312. 'order' => array('reorder' => 'desc','cdate' => 'desc'),
  313. 'limit' => '0,1000',
  314. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  315. ),
  316. 'getHome' => array
  317. (
  318. # 匹配的正则或函数 选填项
  319. 'option' => array
  320. (
  321. 'ids' => array('yes-id', 'in'),
  322. 'name' => array('yes', 'like'),
  323. 'id' => 'yes',
  324. 'status' => 1,
  325. 'state' => 1,
  326. ),
  327. 'type' => 'all',
  328. 'order' => array('top' => 'desc', 'reorder' => 'desc', 'cdate' => 'desc'),
  329. 'limit' => '0,10',
  330. 'col' => '*',
  331. ),
  332. 'getAll' => array
  333. (
  334. # 匹配的正则或函数 选填项
  335. 'option' => array
  336. (
  337. 'status' => 'yes',
  338. 'state' => 1,
  339. ),
  340. 'type' => 'all',
  341. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  342. 'col' => '*',
  343. ),
  344. ),
  345. );