xuniren.php 12 KB

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