xuniren.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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. (
  22. -1 => array('id' => '', 'name' => '全部造物主',),
  23. );
  24. $info = Dever::db('content/creater')->state();
  25. if($info)
  26. {
  27. $array += $info;
  28. }
  29. return $array;
  30. };
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'xuniren',
  35. # 显示给用户看的名称
  36. 'lang' => '虚拟人管理',
  37. 'order' => 99,
  38. 'end' => array
  39. (
  40. 'insert' => 'content/lib/manage.updateXnr',
  41. 'update' => 'content/lib/manage.updateXnr',
  42. ),
  43. # 同步更新另外一个或多个表的多条关联数据,以逗号隔开
  44. 'sync' => array
  45. (
  46. 'content/creater_xuniren' => array
  47. (
  48. # 更新时的条件,另外一个表的字段 => 本表的字段
  49. 'where' => array('xid', 'id'),
  50. # 要更新的数据
  51. 'update' => array('cid' => 'creater_ids'),
  52. # 同步更新的类型,delete为先删再插入,update为先查询是否存在,存在直接更新,不存在则插入, only为仅更新
  53. 'type' => 'delete',
  54. )
  55. ),
  56. # 数据结构
  57. 'struct' => array
  58. (
  59. 'id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => 'ID',
  63. 'default' => '',
  64. 'desc' => '',
  65. 'match' => 'is_numeric',
  66. 'list' => true,
  67. ),
  68. 'name' => array
  69. (
  70. 'type' => 'varchar-80',
  71. 'name' => '名称',
  72. 'default' => '',
  73. 'desc' => '名称',
  74. 'match' => 'is_string',
  75. 'update' => 'text',
  76. 'list' => true,
  77. 'search' => 'fulltext',
  78. ),
  79. 'ename' => array
  80. (
  81. 'type' => 'varchar-30',
  82. 'name' => '英文名称',
  83. 'default' => '',
  84. 'desc' => '英文名称',
  85. 'match' => 'is_string',
  86. //'update' => 'text',
  87. //'list' => true,
  88. //'search' => 'fulltext',
  89. ),
  90. 'shou' => array
  91. (
  92. 'type' => 'varchar-80',
  93. 'name' => '首字母',
  94. 'default' => '',
  95. 'desc' => '首字母',
  96. 'match' => 'is_string',
  97. ),
  98. 'pic' => array
  99. (
  100. 'type' => 'text-255',
  101. 'name' => '形象大图-可以上传多张,图片尺寸530*800px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  102. 'default' => '',
  103. 'desc' => '形象大图',
  104. 'match' => 'option',
  105. 'update' => 'images',
  106. 'key' => '1',
  107. 'place' => '530*800',
  108. ),
  109. 'sex' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '性别',
  113. 'default' => '1',
  114. 'desc' => '性别',
  115. 'match' => 'is_numeric',
  116. 'update' => 'select',
  117. 'option' => $sex,
  118. 'search' => 'select',
  119. 'list' => true,
  120. ),
  121. 'bdate' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '出生日期-将根据出生日期计算年龄,为空则展示不详',
  125. 'default' => '',
  126. 'desc' => '出生日期',
  127. 'match' => 'is_numeric',
  128. //'callback' => 'maketime',
  129. //'update' => 'time',
  130. //'list' => 'date("Y-m-d", {bdate})',
  131. ),
  132. 'age' => array
  133. (
  134. 'type' => 'varchar-100',
  135. 'name' => '年龄',
  136. 'match' => 'is_string',
  137. 'default' => '',
  138. 'desc' => '',
  139. 'update' => 'text',
  140. 'list' => true,
  141. ),
  142. 'city' => array
  143. (
  144. 'type' => 'varchar-500',
  145. 'name' => '诞生地',
  146. 'default' => '',
  147. 'desc' => '诞生地',
  148. 'match' => 'is_string',
  149. 'update' => 'text',
  150. ),
  151. 'creater_id' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '造物主-关联单个造物主,废弃',
  155. 'default' => '-1',
  156. 'desc' => '造物主',
  157. 'match' => 'is_numeric',
  158. //'update' => 'select',
  159. //'option' => $creater,
  160. //'search' => 'select',
  161. ),
  162. 'creater_ids' => array
  163. (
  164. 'type' => 'varchar-1000',
  165. 'name' => '关联造物主-关联系统中存在的造物主,直接输入造物主名称,将自动进行匹配出来,之后选择一个即可',
  166. 'default' => '',
  167. 'desc' => '造物主',
  168. 'match' => 'option',
  169. 'update' => 'text',
  170. 'search' => 'select',
  171. 'search' => array
  172. (
  173. 'api' => 'content/creater_xuniren-all',//接口地址,最好是获取多条数据的地址
  174. 'col' => 'cid',//要查询的字段
  175. 'result' => 'xid',//返回的字段
  176. 'search' => 'id',//本表的字段,默认为当前的字段
  177. 'option' => $creater,
  178. ),
  179. //如果要输入带有自动提示的,就打开这个,update=>'text'即可
  180. 'autocomplete' => array('content/lib/manage.getByCreaterName', 'id', 'content/creater-getData'),
  181. //'list' => true,
  182. //显示
  183. //'show' => 'cate=tag/manage.getByCate?cate=',
  184. ),
  185. 'zwz' => array
  186. (
  187. 'type' => 'varchar-500',
  188. 'name' => '手动输入造物主-手动输入造物主的名称,多个用半角","逗号隔开',
  189. 'default' => '',
  190. 'desc' => '手动输入造物主',
  191. 'match' => 'option',
  192. 'update' => 'text',
  193. ),
  194. 'waimao' => array
  195. (
  196. 'type' => 'varchar-500',
  197. 'name' => '外貌特征',
  198. 'default' => '',
  199. 'desc' => '外貌特征',
  200. 'match' => 'is_string',
  201. 'update' => 'textarea',
  202. ),
  203. 'aihao' => array
  204. (
  205. 'type' => 'varchar-500',
  206. 'name' => '爱好特长/职业',
  207. 'default' => '',
  208. 'desc' => '爱好特长/职业',
  209. 'match' => 'is_string',
  210. 'update' => 'textarea',
  211. ),
  212. 'home_info' => array
  213. (
  214. 'type' => 'varchar-500',
  215. 'name' => '首页简介-不能超过50字',
  216. 'default' => '',
  217. 'desc' => '首页简介',
  218. 'match' => 'option',
  219. //'update' => 'textarea',
  220. ),
  221. 'info' => array
  222. (
  223. 'type' => 'varchar-500',
  224. 'name' => '简介-不能超过110字',
  225. 'default' => '',
  226. 'desc' => '简介',
  227. 'match' => 'is_string',
  228. 'update' => 'textarea',
  229. ),
  230. 'news' => array
  231. (
  232. 'type' => 'text-1000',
  233. 'name' => '关联资讯',
  234. 'default' => '',
  235. 'desc' => '关联资讯',
  236. 'match' => 'is_string',
  237. 'update' => array
  238. (
  239. array
  240. (
  241. 'col' => 'name',
  242. 'name' => '资讯标题',
  243. 'default' => '',
  244. 'desc' => '资讯标题',
  245. 'match' => 'is_string',
  246. 'update' => 'text',
  247. ),
  248. array
  249. (
  250. 'col' => 'link',
  251. 'name' => '资讯链接',
  252. 'default' => '',
  253. 'desc' => '资讯链接',
  254. 'match' => 'is_string',
  255. 'update' => 'textarea',
  256. ),
  257. ),
  258. ),
  259. 'pdate' => array
  260. (
  261. 'type' => 'int-11',
  262. 'name' => '初登场时间',
  263. 'match' => 'is_numeric',
  264. 'default' => '',
  265. 'desc' => '',
  266. //'update' => 'time',
  267. //'callback' => 'maketime',
  268. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  269. ),
  270. 'pdate_string' => array
  271. (
  272. 'type' => 'varchar-100',
  273. 'name' => '初登场时间',
  274. 'match' => 'option',
  275. 'default' => '',
  276. 'desc' => '',
  277. 'update' => 'text',
  278. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  279. ),
  280. 'share_title' => array
  281. (
  282. 'type' => 'varchar-100',
  283. 'name' => '分享标题',
  284. 'default' => '',
  285. 'desc' => '分享标题',
  286. 'match' => 'option',
  287. //'update' => 'text',
  288. ),
  289. 'share_pic' => array
  290. (
  291. 'type' => 'varchar-150',
  292. 'name' => '分享图片-图片尺寸200*200px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  293. 'default' => '',
  294. 'desc' => '分享图片',
  295. 'match' => 'option',
  296. //'update' => 'image',
  297. 'key' => '1',
  298. 'place' => '200*200',
  299. //'upload' => 'qiniu',
  300. //'large' => true,
  301. ),
  302. 'share_content' => array
  303. (
  304. 'type' => 'varchar-200',
  305. 'name' => '分享内容',
  306. 'default' => '',
  307. 'desc' => '分享内容',
  308. 'match' => 'option',
  309. //'update' => 'textarea',
  310. ),
  311. 'weibo' => array
  312. (
  313. 'type' => 'varchar-500',
  314. 'name' => '微博地址-输入微博的地址',
  315. 'default' => '',
  316. 'desc' => '请输入微博地址',
  317. 'match' => 'option',
  318. 'update' => 'text',
  319. ),
  320. 'douyin' => array
  321. (
  322. 'type' => 'varchar-600',
  323. 'name' => '抖音地址',
  324. 'default' => '',
  325. 'desc' => '抖音地址',
  326. 'match' => 'option',
  327. 'update' => 'text',
  328. ),
  329. 'bilibili' => array
  330. (
  331. 'type' => 'varchar-600',
  332. 'name' => 'B站地址',
  333. 'default' => '',
  334. 'desc' => 'B站地址',
  335. 'match' => 'option',
  336. 'update' => 'text',
  337. ),
  338. 'ins' => array
  339. (
  340. 'type' => 'varchar-100',
  341. 'name' => 'INS分享内容',
  342. 'default' => '',
  343. 'desc' => 'INS分享内容',
  344. 'match' => 'option',
  345. 'update' => 'text',
  346. ),
  347. 'ins_link' => array
  348. (
  349. 'type' => 'varchar-600',
  350. 'name' => 'INS链接',
  351. 'default' => '',
  352. 'desc' => 'INS链接',
  353. 'match' => 'option',
  354. 'update' => 'text',
  355. ),
  356. 'beizhu' => array
  357. (
  358. 'type' => 'varchar-500',
  359. 'name' => '备注',
  360. 'default' => '',
  361. 'desc' => '备注',
  362. 'match' => 'option',
  363. 'update' => 'textarea',
  364. ),
  365. 'reorder' => array
  366. (
  367. 'type' => 'int-11',
  368. 'name' => '排序(数值越大越靠前)',
  369. 'default' => '1',
  370. 'desc' => '请输入排序',
  371. 'match' => 'option',
  372. //'update' => 'text',
  373. 'search' => 'order',
  374. 'list' => true,
  375. 'order' => 'desc',
  376. 'edit' => true,
  377. ),
  378. 'top' => array
  379. (
  380. 'type' => 'int-11',
  381. 'name' => '是否推荐到首页',
  382. 'default' => '1',
  383. 'desc' => '是否推荐到首页',
  384. 'match' => 'is_numeric',
  385. 'update' => 'select',
  386. 'option' => $top,
  387. 'search' => 'select',
  388. 'list' => true,
  389. 'edit' => true,
  390. ),
  391. 'status' => array
  392. (
  393. 'type' => 'int-11',
  394. 'name' => '登场状态',
  395. 'default' => '1',
  396. 'desc' => '登场状态',
  397. 'match' => 'is_numeric',
  398. 'update' => 'select',
  399. 'option' => $status,
  400. 'search' => 'select',
  401. 'list' => true,
  402. 'edit' => true,
  403. ),
  404. 'state' => array
  405. (
  406. 'type' => 'tinyint-1',
  407. 'name' => '状态',
  408. 'default' => '1',
  409. 'desc' => '请选择状态',
  410. 'match' => 'is_numeric',
  411. ),
  412. 'cdate' => array
  413. (
  414. 'type' => 'int-11',
  415. 'name' => '创建时间',
  416. 'match' => array('is_numeric', time()),
  417. 'desc' => '',
  418. # 只有insert时才生效
  419. 'insert' => true,
  420. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  421. 'search' => 'date',
  422. ),
  423. ),
  424. # 管理功能
  425. 'manage' => array
  426. (
  427. ),
  428. # 更新表结构
  429. 'alter' => array
  430. (
  431. ),
  432. # request 请求接口定义
  433. 'request' => array
  434. (
  435. 'search' => array
  436. (
  437. # 匹配的正则或函数 选填项
  438. 'option' => array
  439. (
  440. 'ids' => array('yes-id', 'in'),
  441. 'name' => array('yes', 'like'),
  442. 'id' => 'yes',
  443. 'status' => 1,
  444. 'state' => 1,
  445. ),
  446. 'type' => 'all',
  447. 'order' => array('reorder' => 'desc','cdate' => 'desc'),
  448. 'limit' => '0,1000',
  449. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  450. ),
  451. 'getHome' => array
  452. (
  453. # 匹配的正则或函数 选填项
  454. 'option' => array
  455. (
  456. 'ids' => array('yes-id', 'in'),
  457. 'name' => array('yes', 'like'),
  458. 'id' => 'yes',
  459. 'status' => 1,
  460. 'state' => 1,
  461. ),
  462. 'type' => 'all',
  463. 'order' => array('top' => 'desc', 'reorder' => 'desc', 'cdate' => 'desc'),
  464. 'limit' => '0,10',
  465. 'col' => '*',
  466. ),
  467. 'getAll' => array
  468. (
  469. # 匹配的正则或函数 选填项
  470. 'option' => array
  471. (
  472. 'status' => 'yes',
  473. 'state' => 1,
  474. ),
  475. 'type' => 'all',
  476. 'order' => array('shou' => 'asc', 'reorder' => 'desc', 'id' => 'desc'),
  477. 'col' => '*|shou|',
  478. ),
  479. 'getDataByCreater' => array
  480. (
  481. # 匹配的正则或函数 选填项
  482. 'option' => array
  483. (
  484. 'creater_id' => 'yes',
  485. 'status' => 1,
  486. 'state' => 1,
  487. ),
  488. 'type' => 'all',
  489. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  490. 'page' => array(100, 'list'),
  491. 'col' => '*',
  492. ),
  493. ),
  494. );