xuniren.php 11 KB

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