xuniren.php 11 KB

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