xuniren.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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. 'info' => array
  213. (
  214. 'type' => 'varchar-500',
  215. 'name' => '简介',
  216. 'default' => '',
  217. 'desc' => '简介',
  218. 'match' => 'is_string',
  219. 'update' => 'textarea',
  220. ),
  221. 'news' => array
  222. (
  223. 'type' => 'text-1000',
  224. 'name' => '关联资讯',
  225. 'default' => '',
  226. 'desc' => '关联资讯',
  227. 'match' => 'is_string',
  228. 'update' => array
  229. (
  230. array
  231. (
  232. 'col' => 'name',
  233. 'name' => '资讯标题',
  234. 'default' => '',
  235. 'desc' => '资讯标题',
  236. 'match' => 'is_string',
  237. 'update' => 'text',
  238. ),
  239. array
  240. (
  241. 'col' => 'link',
  242. 'name' => '资讯链接',
  243. 'default' => '',
  244. 'desc' => '资讯链接',
  245. 'match' => 'is_string',
  246. 'update' => 'textarea',
  247. ),
  248. ),
  249. ),
  250. 'pdate' => array
  251. (
  252. 'type' => 'int-11',
  253. 'name' => '初登场时间',
  254. 'match' => 'is_numeric',
  255. 'default' => '',
  256. 'desc' => '',
  257. //'update' => 'time',
  258. //'callback' => 'maketime',
  259. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  260. ),
  261. 'pdate_string' => array
  262. (
  263. 'type' => 'varchar-100',
  264. 'name' => '初登场时间',
  265. 'match' => 'option',
  266. 'default' => '',
  267. 'desc' => '',
  268. 'update' => 'text',
  269. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  270. ),
  271. 'share_title' => array
  272. (
  273. 'type' => 'varchar-100',
  274. 'name' => '分享标题',
  275. 'default' => '',
  276. 'desc' => '分享标题',
  277. 'match' => 'option',
  278. 'update' => 'text',
  279. ),
  280. 'share_pic' => array
  281. (
  282. 'type' => 'varchar-150',
  283. 'name' => '分享图片-图片尺寸200*200px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  284. 'default' => '',
  285. 'desc' => '分享图片',
  286. 'match' => 'option',
  287. 'update' => 'image',
  288. 'key' => '1',
  289. 'place' => '200*200',
  290. //'upload' => 'qiniu',
  291. //'large' => true,
  292. ),
  293. 'share_content' => array
  294. (
  295. 'type' => 'varchar-200',
  296. 'name' => '分享内容',
  297. 'default' => '',
  298. 'desc' => '分享内容',
  299. 'match' => 'option',
  300. 'update' => 'textarea',
  301. ),
  302. 'weibo' => array
  303. (
  304. 'type' => 'varchar-500',
  305. 'name' => '微博地址-输入微博的地址',
  306. 'default' => '',
  307. 'desc' => '请输入微博地址',
  308. 'match' => 'option',
  309. 'update' => 'text',
  310. ),
  311. 'douyin' => array
  312. (
  313. 'type' => 'varchar-600',
  314. 'name' => '抖音地址',
  315. 'default' => '',
  316. 'desc' => '抖音地址',
  317. 'match' => 'option',
  318. 'update' => 'text',
  319. ),
  320. 'bilibili' => array
  321. (
  322. 'type' => 'varchar-600',
  323. 'name' => 'B站地址',
  324. 'default' => '',
  325. 'desc' => 'B站地址',
  326. 'match' => 'option',
  327. 'update' => 'text',
  328. ),
  329. 'ins' => array
  330. (
  331. 'type' => 'varchar-100',
  332. 'name' => 'INS账号',
  333. 'default' => '',
  334. 'desc' => 'INS账号',
  335. 'match' => 'option',
  336. 'update' => 'text',
  337. ),
  338. 'ins_link' => array
  339. (
  340. 'type' => 'varchar-600',
  341. 'name' => 'INS链接',
  342. 'default' => '',
  343. 'desc' => 'INS链接',
  344. 'match' => 'option',
  345. 'update' => 'text',
  346. ),
  347. 'beizhu' => array
  348. (
  349. 'type' => 'varchar-500',
  350. 'name' => '备注',
  351. 'default' => '',
  352. 'desc' => '备注',
  353. 'match' => 'option',
  354. 'update' => 'textarea',
  355. ),
  356. 'reorder' => array
  357. (
  358. 'type' => 'int-11',
  359. 'name' => '排序(数值越大越靠前)',
  360. 'default' => '1',
  361. 'desc' => '请输入排序',
  362. 'match' => 'option',
  363. //'update' => 'text',
  364. 'search' => 'order',
  365. 'list' => true,
  366. 'order' => 'desc',
  367. 'edit' => true,
  368. ),
  369. 'top' => array
  370. (
  371. 'type' => 'int-11',
  372. 'name' => '是否推荐到首页',
  373. 'default' => '1',
  374. 'desc' => '是否推荐到首页',
  375. 'match' => 'is_numeric',
  376. 'update' => 'select',
  377. 'option' => $top,
  378. 'search' => 'select',
  379. 'list' => true,
  380. 'edit' => true,
  381. ),
  382. 'status' => array
  383. (
  384. 'type' => 'int-11',
  385. 'name' => '登场状态',
  386. 'default' => '1',
  387. 'desc' => '登场状态',
  388. 'match' => 'is_numeric',
  389. 'update' => 'select',
  390. 'option' => $status,
  391. 'search' => 'select',
  392. 'list' => true,
  393. 'edit' => true,
  394. ),
  395. 'state' => array
  396. (
  397. 'type' => 'tinyint-1',
  398. 'name' => '状态',
  399. 'default' => '1',
  400. 'desc' => '请选择状态',
  401. 'match' => 'is_numeric',
  402. ),
  403. 'cdate' => array
  404. (
  405. 'type' => 'int-11',
  406. 'name' => '创建时间',
  407. 'match' => array('is_numeric', time()),
  408. 'desc' => '',
  409. # 只有insert时才生效
  410. 'insert' => true,
  411. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  412. 'search' => 'date',
  413. ),
  414. ),
  415. # 管理功能
  416. 'manage' => array
  417. (
  418. ),
  419. # 更新表结构
  420. 'alter' => array
  421. (
  422. ),
  423. # request 请求接口定义
  424. 'request' => array
  425. (
  426. 'search' => array
  427. (
  428. # 匹配的正则或函数 选填项
  429. 'option' => array
  430. (
  431. 'ids' => array('yes-id', 'in'),
  432. 'name' => array('yes', 'like'),
  433. 'id' => 'yes',
  434. 'status' => 1,
  435. 'state' => 1,
  436. ),
  437. 'type' => 'all',
  438. 'order' => array('reorder' => 'desc','cdate' => 'desc'),
  439. 'limit' => '0,1000',
  440. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  441. ),
  442. 'getHome' => array
  443. (
  444. # 匹配的正则或函数 选填项
  445. 'option' => array
  446. (
  447. 'ids' => array('yes-id', 'in'),
  448. 'name' => array('yes', 'like'),
  449. 'id' => 'yes',
  450. 'status' => 1,
  451. 'state' => 1,
  452. ),
  453. 'type' => 'all',
  454. 'order' => array('top' => 'desc', 'reorder' => 'desc', 'cdate' => 'desc'),
  455. 'limit' => '0,10',
  456. 'col' => '*',
  457. ),
  458. 'getAll' => array
  459. (
  460. # 匹配的正则或函数 选填项
  461. 'option' => array
  462. (
  463. 'status' => 'yes',
  464. 'state' => 1,
  465. ),
  466. 'type' => 'all',
  467. 'order' => array('shou' => 'asc', 'reorder' => 'desc', 'id' => 'desc'),
  468. 'col' => '*|shou|',
  469. ),
  470. 'getDataByCreater' => array
  471. (
  472. # 匹配的正则或函数 选填项
  473. 'option' => array
  474. (
  475. 'creater_id' => 'yes',
  476. 'status' => 1,
  477. 'state' => 1,
  478. ),
  479. 'type' => 'all',
  480. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  481. 'page' => array(100, 'list'),
  482. 'col' => '*',
  483. ),
  484. ),
  485. );