Art.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <?php
  2. namespace app\common\model;
  3. use think\Db;
  4. use think\Cache;
  5. use app\common\util\Pinyin;
  6. class Art extends Base {
  7. // 设置数据表(不含前缀)
  8. protected $name = 'art';
  9. // 定义时间戳字段名
  10. protected $createTime = '';
  11. protected $updateTime = '';
  12. // 自动完成
  13. protected $auto = [];
  14. protected $insert = [];
  15. protected $update = [];
  16. public function getArtStatusTextAttr($val,$data)
  17. {
  18. $arr = [0=>lang('disable'),1=>lang('enable')];
  19. return $arr[$data['art_status']];
  20. }
  21. public function getArtContentTextAttr($val,$data)
  22. {
  23. $arr = explode('$$$',$data['art_content']);
  24. return $arr;
  25. }
  26. public function countData($where)
  27. {
  28. $total = $this->where($where)->count();
  29. return $total;
  30. }
  31. public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
  32. {
  33. $page = $page > 0 ? (int)$page : 1;
  34. $limit = $limit ? (int)$limit : 20;
  35. $start = $start ? (int)$start : 0;
  36. if(!is_array($where)){
  37. $where = json_decode($where,true);
  38. }
  39. $where2='';
  40. if(!empty($where['_string'])){
  41. $where2 = $where['_string'];
  42. unset($where['_string']);
  43. }
  44. $limit_str = ($limit * ($page-1) + $start) .",".$limit;
  45. if($totalshow==1) {
  46. $total = $this->where($where)->count();
  47. }
  48. $list = Db::name('Art')->field($field)->where($where)->where($where2)->order($order)->limit($limit_str)->select();
  49. //dump($where);die;
  50. //echo $this->getLastSql();die;
  51. //分类
  52. $type_list = model('Type')->getCache('type_list');
  53. //用户组
  54. $group_list = model('Group')->getCache('group_list');
  55. foreach($list as $k=>$v){
  56. if($addition==1){
  57. if(!empty($v['type_id'])) {
  58. $list[$k]['type'] = $type_list[$v['type_id']];
  59. $list[$k]['type_1'] = $type_list[$list[$k]['type']['type_pid']];
  60. }
  61. if(!empty($v['group_id'])) {
  62. $list[$k]['group'] = $group_list[$v['group_id']];
  63. }
  64. }
  65. }
  66. return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list];
  67. }
  68. public function listRepeatData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1)
  69. {
  70. $page = $page > 0 ? (int)$page : 1;
  71. $limit = $limit ? (int)$limit : 20;
  72. $start = $start ? (int)$start : 0;
  73. if(!is_array($where)){
  74. $where = json_decode($where,true);
  75. }
  76. $limit_str = ($limit * ($page-1) + $start) .",".$limit;
  77. $total = $this
  78. ->join('tmpart t','t.name1 = art_name')
  79. ->where($where)
  80. ->count();
  81. $list = Db::name('Art')
  82. ->join('tmpart t','t.name1 = art_name')
  83. ->field($field)
  84. ->where($where)
  85. ->order($order)
  86. ->limit($limit_str)
  87. ->select();
  88. //dump($where);die;
  89. //echo $this->getLastSql();die;
  90. //分类
  91. $type_list = model('Type')->getCache('type_list');
  92. //用户组
  93. $group_list = model('Group')->getCache('group_list');
  94. foreach($list as $k=>$v){
  95. if($addition==1){
  96. if(!empty($v['type_id'])) {
  97. $list[$k]['type'] = $type_list[$v['type_id']];
  98. $list[$k]['type_1'] = $type_list[$list[$k]['type']['type_pid']];
  99. }
  100. if(!empty($v['group_id'])) {
  101. $list[$k]['group'] = $group_list[$v['group_id']];
  102. }
  103. }
  104. }
  105. return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list];
  106. }
  107. public function listCacheData($lp)
  108. {
  109. if (!is_array($lp)) {
  110. $lp = json_decode($lp, true);
  111. }
  112. $order = $lp['order'];
  113. $by = $lp['by'];
  114. $type = $lp['type'];
  115. $ids = $lp['ids'];
  116. $rel = $lp['rel'];
  117. $paging = $lp['paging'];
  118. $pageurl = $lp['pageurl'];
  119. $level = $lp['level'];
  120. $wd = $lp['wd'];
  121. $tag = $lp['tag'];
  122. $class = $lp['class'];
  123. $letter = $lp['letter'];
  124. $start = intval(abs($lp['start']));
  125. $num = intval(abs($lp['num']));
  126. $half = intval(abs($lp['half']));
  127. $timeadd = $lp['timeadd'];
  128. $timehits = $lp['timehits'];
  129. $time = $lp['time'];
  130. $hitsmonth = $lp['hitsmonth'];
  131. $hitsweek = $lp['hitsweek'];
  132. $hitsday = $lp['hitsday'];
  133. $hits = $lp['hits'];
  134. $not = $lp['not'];
  135. $cachetime = $lp['cachetime'];
  136. $typenot = $lp['typenot'];
  137. $name = $lp['name'];
  138. $page = 1;
  139. $where = [];
  140. $totalshow=0;
  141. if(empty($num)){
  142. $num = 20;
  143. }
  144. if($start>1){
  145. $start--;
  146. }
  147. if(!in_array($paging, ['yes', 'no'])) {
  148. $paging = 'no';
  149. }
  150. $param = mac_param_url();
  151. if($paging=='yes') {
  152. $param = mac_search_len_check($param);
  153. $totalshow = 1;
  154. if(!empty($param['id'])) {
  155. //$type = intval($param['id']);
  156. }
  157. if(!empty($param['ids'])){
  158. $ids = $param['ids'];
  159. }
  160. if(!empty($param['tid'])) {
  161. $tid = intval($param['tid']);
  162. }
  163. if(!empty($param['level'])) {
  164. $level = $param['level'];
  165. }
  166. if(!empty($param['letter'])) {
  167. $letter = $param['letter'];
  168. }
  169. if(!empty($param['wd'])) {
  170. $wd = $param['wd'];
  171. }
  172. if(!empty($param['name'])) {
  173. $name = $param['name'];
  174. }
  175. if(!empty($param['tag'])) {
  176. $tag = $param['tag'];
  177. }
  178. if(!empty($param['class'])) {
  179. $class = $param['class'];
  180. }
  181. if(!empty($param['by'])){
  182. $by = $param['by'];
  183. }
  184. if(!empty($param['order'])){
  185. $order = $param['order'];
  186. }
  187. if(!empty($param['page'])){
  188. $page = intval($param['page']);
  189. }
  190. foreach($param as $k=>$v){
  191. if(empty($v)){
  192. unset($param[$k]);
  193. }
  194. }
  195. if(empty($pageurl)){
  196. $pageurl = 'art/type';
  197. }
  198. $param['page'] = 'PAGELINK';
  199. if($pageurl=='art/type' || $pageurl=='art/show'){
  200. $type = intval( $GLOBALS['type_id'] );
  201. $type_list = model('Type')->getCache('type_list');
  202. $type_info = $type_list[$type];
  203. $flag='type';
  204. if($pageurl == 'art/show'){
  205. $flag='show';
  206. }
  207. $pageurl = mac_url_type($type_info,$param,$flag);
  208. }
  209. else{
  210. $pageurl = mac_url($pageurl,$param);
  211. }
  212. }
  213. $where['art_status'] = ['eq',1];
  214. if(!empty($level)) {
  215. if($level=='all'){
  216. $level = '1,2,3,4,5,6,7,8,9';
  217. }
  218. $where['art_level'] = ['in',explode(',',$level)];
  219. }
  220. if(!empty($ids)) {
  221. if($ids!='all'){
  222. $where['art_id'] = ['in',explode(',',$ids)];
  223. }
  224. }
  225. if(!empty($not)){
  226. $where['art_id'] = ['not in',explode(',',$not)];
  227. }
  228. if(!empty($rel)){
  229. $tmp = explode(',',$rel);
  230. if(is_numeric($rel) || mac_array_check_num($tmp)==true ){
  231. $where['art_id'] = ['in',$tmp];
  232. }
  233. else{
  234. $where['art_rel_art'] = ['like', mac_like_arr($rel),'OR'];
  235. }
  236. }
  237. if(!empty($letter)){
  238. if(substr($letter,0,1)=='0' && substr($letter,2,1)=='9'){
  239. $letter='0,1,2,3,4,5,6,7,8,9';
  240. }
  241. $where['art_letter'] = ['in',explode(',',$letter)];
  242. }
  243. if(!empty($timeadd)){
  244. $s = intval(strtotime($timeadd));
  245. $where['art_time_add'] =['gt',$s];
  246. }
  247. if(!empty($timehits)){
  248. $s = intval(strtotime($timehits));
  249. $where['art_time_hits'] =['gt',$s];
  250. }
  251. if(!empty($time)){
  252. $s = intval(strtotime($time));
  253. $where['art_time'] =['gt',$s];
  254. }
  255. if(!empty($type)) {
  256. if($type=='current'){
  257. $type = intval( $GLOBALS['type_id'] );
  258. }
  259. if($type!='all') {
  260. $tmp_arr = explode(',', $type);
  261. $type_list = model('Type')->getCache('type_list');
  262. $type = [];
  263. foreach ($type_list as $k2 => $v2) {
  264. if (in_array($v2['type_id'] . '', $tmp_arr) || in_array($v2['type_pid'] . '', $tmp_arr)) {
  265. $type[] = $v2['type_id'];
  266. }
  267. }
  268. $type = array_unique($type);
  269. $where['type_id'] = ['in', implode(',', $type)];
  270. }
  271. }
  272. if(!empty($typenot)){
  273. $where['type_id'] = ['not in',$typenot];
  274. }
  275. if(!empty($tid)) {
  276. $where['type_id|type_id_1'] = ['eq',$tid];
  277. }
  278. if(!empty($hitsmonth)){
  279. $tmp = explode(' ',$hitsmonth);
  280. if(count($tmp)==1){
  281. $where['art_hits_month'] = ['gt', $tmp];
  282. }
  283. else{
  284. $where['art_hits_month'] = [$tmp[0],$tmp[1]];
  285. }
  286. }
  287. if(!empty($hitsweek)){
  288. $tmp = explode(' ',$hitsweek);
  289. if(count($tmp)==1){
  290. $where['art_hits_week'] = ['gt', $tmp];
  291. }
  292. else{
  293. $where['art_hits_week'] = [$tmp[0],$tmp[1]];
  294. }
  295. }
  296. if(!empty($hitsday)){
  297. $tmp = explode(' ',$hitsday);
  298. if(count($tmp)==1){
  299. $where['art_hits_day'] = ['gt', $tmp];
  300. }
  301. else{
  302. $where['art_hits_day'] = [$tmp[0],$tmp[1]];
  303. }
  304. }
  305. if(!empty($hits)){
  306. $tmp = explode(' ',$hits);
  307. if(count($tmp)==1){
  308. $where['art_hits'] = ['gt', $tmp];
  309. }
  310. else{
  311. $where['art_hits'] = [$tmp[0],$tmp[1]];
  312. }
  313. }
  314. if(!empty($wd)) {
  315. $role = 'art_name';
  316. if(!empty($GLOBALS['config']['app']['search_art_rule'])){
  317. $role .= '|'.$GLOBALS['config']['app']['search_art_rule'];
  318. }
  319. $where[$role] = ['like', '%' . $wd . '%'];
  320. }
  321. if(!empty($name)) {
  322. $where['art_name'] = ['like', mac_like_arr($name),'OR'];
  323. }
  324. if(!empty($tag)) {
  325. $where['art_tag'] = ['like', mac_like_arr($tag),'OR'];
  326. }
  327. if(!empty($class)) {
  328. $where['art_class'] = ['like',mac_like_arr($class),'OR'];
  329. }
  330. if(defined('ENTRANCE') && ENTRANCE == 'index' && $GLOBALS['config']['app']['popedom_filter'] ==1){
  331. $type_ids = mac_get_popedom_filter($GLOBALS['user']['group']['group_type']);
  332. if(!empty($type_ids)){
  333. if(!empty($where['type_id'])){
  334. $where['type_id'] = [ $where['type_id'],['not in', explode(',',$type_ids)] ];
  335. }
  336. else{
  337. $where['type_id'] = ['not in', explode(',',$type_ids)];
  338. }
  339. }
  340. }
  341. if($by=='rnd'){
  342. $data_count = $this->countData($where);
  343. $page_total = floor($data_count / $lp['num']) + 1;
  344. if($data_count < $lp['num']){
  345. $lp['num'] = $data_count;
  346. }
  347. $randi = @mt_rand(1, $page_total);
  348. $page = $randi;
  349. $by = 'hits_week';
  350. $order = 'desc';
  351. }
  352. if(!in_array($by, ['id', 'time','time_add','score','hits','hits_day','hits_week','hits_month','up','down','level','rnd'])) {
  353. $by = 'time';
  354. }
  355. if(!in_array($order, ['asc', 'desc'])) {
  356. $order = 'desc';
  357. }
  358. $order= 'art_'.$by .' ' . $order;
  359. $where_cache = $where;
  360. if(!empty($randi)){
  361. unset($where_cache['art_id']);
  362. $where_cache['order'] = 'rnd';
  363. }
  364. $cach_name = $GLOBALS['config']['app']['cache_flag']. '_' .md5('art_listcache_'.http_build_query($where_cache).'_'.$order.'_'.$page.'_'.$num.'_'.$start.'_'.$pageurl);
  365. $res = Cache::get($cach_name);
  366. if(empty($cachetime)){
  367. $cachetime = $GLOBALS['config']['app']['cache_time'];
  368. }
  369. if($GLOBALS['config']['app']['cache_core']==0 || empty($res)) {
  370. $res = $this->listData($where,$order,$page,$num,$start,'*',1,$totalshow);
  371. if($GLOBALS['config']['app']['cache_core']==1) {
  372. Cache::set($cach_name, $res, $cachetime);
  373. }
  374. }
  375. $res['pageurl'] = $pageurl;
  376. $res['half'] = $half;
  377. return $res;
  378. }
  379. public function infoData($where,$field='*',$cache=0)
  380. {
  381. if(empty($where) || !is_array($where)){
  382. return ['code'=>1001,'msg'=>lang('param_err')];
  383. }
  384. $data_cache = false;
  385. $key = $GLOBALS['config']['app']['cache_flag']. '_'.'art_detail_'.$where['art_id'][1].'_'.$where['art_en'][1];
  386. if($where['art_id'][0]=='eq' || $where['art_en'][0]=='eq'){
  387. $data_cache = true;
  388. }
  389. if($GLOBALS['config']['app']['cache_core']==1 && $data_cache) {
  390. $info = Cache::get($key);
  391. }
  392. if($GLOBALS['config']['app']['cache_core']==0 || $cache==0 || empty($info['art_id'])) {
  393. $info = $this->field($field)->where($where)->find();
  394. if (empty($info)) {
  395. return ['code' => 1002, 'msg' => lang('obtain_err')];
  396. }
  397. $info = $info->toArray();
  398. //内容
  399. if (!empty($info['art_content'])) {
  400. $info['art_page_list'] = mac_art_list($info['art_title'], $info['art_note'], $info['art_content']);
  401. $info['art_page_total'] = count($info['art_page_list']);
  402. }
  403. if(!empty($info['art_pic_screenshot'])){
  404. $info['art_pic_screenshot_list'] = mac_screenshot_list($info['art_pic_screenshot']);
  405. }
  406. //分类
  407. if (!empty($info['type_id'])) {
  408. $type_list = model('Type')->getCache('type_list');
  409. $info['type'] = $type_list[$info['type_id']];
  410. $info['type_1'] = $type_list[$info['type']['type_pid']];
  411. }
  412. //用户组
  413. if (!empty($info['group_id'])) {
  414. $group_list = model('Group')->getCache('group_list');
  415. $info['group'] = $group_list[$info['group_id']];
  416. }
  417. if($GLOBALS['config']['app']['cache_core']==1 && $data_cache && $cache==1) {
  418. Cache::set($key, $info);
  419. }
  420. }
  421. return ['code'=>1,'msg'=>lang('obtain_ok'),'info'=>$info];
  422. }
  423. public function saveData($data)
  424. {
  425. $validate = \think\Loader::validate('Art');
  426. if(!$validate->check($data)){
  427. return ['code'=>1001,'msg'=>lang('param_err').':'.$validate->getError() ];
  428. }
  429. $key = 'art_detail_'.$data['art_id'];
  430. Cache::rm($key);
  431. $key = 'art_detail_'.$data['art_en'];
  432. Cache::rm($key);
  433. $key = 'art_detail_'.$data['art_id'].'_'.$data['art_en'];
  434. Cache::rm($key);
  435. $type_list = model('Type')->getCache('type_list');
  436. $type_info = $type_list[$data['type_id']];
  437. $data['type_id_1'] = $type_info['type_pid'];
  438. if(empty($data['art_en'])){
  439. $data['art_en'] = Pinyin::get($data['art_name']);
  440. }
  441. if(empty($data['art_letter'])){
  442. $data['art_letter'] = strtoupper(substr($data['art_en'],0,1));
  443. }
  444. if(!empty($data['art_pic_screenshot'])){
  445. $data['art_pic_screenshot'] = str_replace( array(chr(10),chr(13)), array('','#'),$data['art_pic_screenshot']);
  446. }
  447. if(!empty($data['art_content'])) {
  448. $data['art_content'] = join('$$$', $data['art_content']);
  449. $data['art_title'] = join('$$$', $data['art_title']);
  450. $data['art_note'] = join('$$$', $data['art_note']);
  451. $pattern_src = '/<img[\s\S]*?src\s*=\s*[\"|\'](.*?)[\"|\'][\s\S]*?>/';
  452. @preg_match_all($pattern_src, $data['art_content'], $match_src1);
  453. if (!empty($match_src1)) {
  454. foreach ($match_src1[1] as $v1) {
  455. $v2 = str_replace($GLOBALS['config']['upload']['protocol'] . ':', 'mac:', $v1);
  456. $data['art_content'] = str_replace($v1, $v2, $data['art_content']);
  457. }
  458. if (empty($data['art_pic'])) {
  459. $data['art_pic'] = (string)$match_src1[1][0];
  460. }
  461. }
  462. unset($match_src1);
  463. }
  464. if(empty($data['art_blurb'])){
  465. $data['art_blurb'] = mac_substring( str_replace('$$$','', strip_tags($data['art_content'])),100);
  466. }
  467. if($data['uptime']==1){
  468. $data['art_time'] = time();
  469. }
  470. if($data['uptag']==1){
  471. $data['art_tag'] = mac_get_tag($data['art_name'], $data['art_content']);
  472. }
  473. unset($data['uptime']);
  474. unset($data['uptag']);
  475. // xss过滤
  476. $filter_fields = [
  477. 'art_name',
  478. 'art_sub',
  479. 'art_en',
  480. 'art_color',
  481. 'art_from',
  482. 'art_author',
  483. 'art_tag',
  484. 'art_class',
  485. 'art_pic',
  486. 'art_pic_thumb',
  487. 'art_pic_slide',
  488. 'art_blurb',
  489. 'art_remarks',
  490. 'art_jumpurl',
  491. 'art_tpl',
  492. 'art_rel_art',
  493. 'art_rel_vod',
  494. 'art_pwd',
  495. 'art_pwd_url',
  496. ];
  497. foreach ($filter_fields as $filter_field) {
  498. if (!isset($data[$filter_field])) {
  499. continue;
  500. }
  501. $data[$filter_field] = mac_filter_xss($data[$filter_field]);
  502. }
  503. if(!empty($data['art_id'])){
  504. $where=[];
  505. $where['art_id'] = ['eq',$data['art_id']];
  506. $res = $this->allowField(true)->where($where)->update($data);
  507. }
  508. else{
  509. $data['art_time_add'] = time();
  510. $data['art_time'] = time();
  511. $res = $this->allowField(true)->insert($data);
  512. }
  513. if(false === $res){
  514. return ['code'=>1002,'msg'=>lang('save_err').':'.$this->getError() ];
  515. }
  516. return ['code'=>1,'msg'=>lang('save_ok')];
  517. }
  518. public function delData($where)
  519. {
  520. $list = $this->listData($where,'',1,9999);
  521. if($list['code'] !==1){
  522. return ['code'=>1001,'msg'=>lang('del_err').':'.$this->getError() ];
  523. }
  524. $path = './';
  525. foreach($list['list'] as $k=>$v){
  526. $pic = $path.$v['art_pic'];
  527. if(file_exists($pic) && (substr($pic,0,8) == "./upload") || count( explode("./",$pic) ) ==1){
  528. unlink($pic);
  529. }
  530. $pic = $path.$v['art_pic_thumb'];
  531. if(file_exists($pic) && (substr($pic,0,8) == "./upload") || count( explode("./",$pic) ) ==1){
  532. unlink($pic);
  533. }
  534. $pic = $path.$v['art_pic_slide'];
  535. if(file_exists($pic) && (substr($pic,0,8) == "./upload") || count( explode("./",$pic) ) ==1){
  536. unlink($pic);
  537. }
  538. if($GLOBALS['config']['view']['art_detail'] ==2 ){
  539. $lnk = mac_url_art_detail($v);
  540. $lnk = reset_html_filename($lnk);
  541. if(file_exists($lnk)){
  542. unlink($lnk);
  543. }
  544. }
  545. }
  546. $res = $this->where($where)->delete();
  547. if($res===false){
  548. return ['code'=>1001,'msg'=>lang('del_err').':'.$this->getError() ];
  549. }
  550. return ['code'=>1,'msg'=>lang('del_ok')];
  551. }
  552. public function fieldData($where,$update)
  553. {
  554. if(!is_array($update)){
  555. return ['code'=>1001,'msg'=>lang('param_err')];
  556. }
  557. $res = $this->allowField(true)->where($where)->update($update);
  558. if($res===false){
  559. return ['code'=>1001,'msg'=>lang('set_err').':'.$this->getError() ];
  560. }
  561. $list = $this->field('art_id,art_name,art_en')->where($where)->select();
  562. foreach($list as $k=>$v){
  563. $key = 'art_detail_'.$v['art_id'];
  564. Cache::rm($key);
  565. $key = 'art_detail_'.$v['art_en'];
  566. Cache::rm($key);
  567. }
  568. return ['code'=>1,'msg'=>lang('set_ok')];
  569. }
  570. public function updateToday($flag='art')
  571. {
  572. $today = strtotime(date('Y-m-d'));
  573. $where = [];
  574. $where['art_time'] = ['gt',$today];
  575. if($flag=='type'){
  576. $ids = $this->where($where)->column('type_id');
  577. }
  578. else{
  579. $ids = $this->where($where)->column('art_id');
  580. }
  581. if(empty($ids)){
  582. $ids = [];
  583. }else{
  584. $ids = array_unique($ids);
  585. }
  586. return ['code'=>1,'msg'=>lang('obtain_ok'),'data'=> join(',',$ids) ];
  587. }
  588. }