Entry.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. <?php
  2. class Entry extends Model {
  3. private $id = null;
  4. private $guid;
  5. private $title;
  6. private $author;
  7. private $content;
  8. private $link;
  9. private $date;
  10. private $is_read;
  11. private $is_favorite;
  12. private $is_public;
  13. private $feed;
  14. private $tags;
  15. private $notes;
  16. private $lastUpdate;
  17. public function __construct ($feed = '', $guid = '', $title = '', $author = '', $content = '',
  18. $link = '', $pubdate = 0, $is_read = false, $is_favorite = false,
  19. $is_public = false) {
  20. $this->_guid ($guid);
  21. $this->_title ($title);
  22. $this->_author ($author);
  23. $this->_content ($content);
  24. $this->_link ($link);
  25. $this->_date ($pubdate);
  26. $this->_isRead ($is_read);
  27. $this->_isFavorite ($is_favorite);
  28. $this->_isPublic ($is_public);
  29. $this->_feed ($feed);
  30. $this->_lastUpdate ($pubdate);
  31. $this->_notes ('');
  32. $this->_tags (array ());
  33. }
  34. public function id () {
  35. if(is_null($this->id)) {
  36. return small_hash ($this->guid . Configuration::selApplication ());
  37. } else {
  38. return $this->id;
  39. }
  40. }
  41. public function guid () {
  42. return $this->guid;
  43. }
  44. public function title () {
  45. return $this->title;
  46. }
  47. public function author () {
  48. if (is_null ($this->author)) {
  49. return '';
  50. } else {
  51. return $this->author;
  52. }
  53. }
  54. public function content () {
  55. return $this->content;
  56. }
  57. public function link () {
  58. return $this->link;
  59. }
  60. public function date ($raw = false) {
  61. if ($raw) {
  62. return $this->date;
  63. } else {
  64. return timestamptodate ($this->date);
  65. }
  66. }
  67. public function isRead () {
  68. return $this->is_read;
  69. }
  70. public function isFavorite () {
  71. return $this->is_favorite;
  72. }
  73. public function isPublic () {
  74. return $this->is_public;
  75. }
  76. public function feed ($object = false) {
  77. if ($object) {
  78. $feedDAO = new FeedDAO ();
  79. return $feedDAO->searchById ($this->feed);
  80. } else {
  81. return $this->feed;
  82. }
  83. }
  84. public function tags ($inString = false) {
  85. if ($inString) {
  86. if (!empty ($this->tags)) {
  87. return '#' . implode(' #', $this->tags);
  88. } else {
  89. return '';
  90. }
  91. } else {
  92. return $this->tags;
  93. }
  94. }
  95. public function notes ($raw = true, $parse_tags = true) {
  96. if ($raw) {
  97. return $this->notes;
  98. } else {
  99. if($parse_tags) {
  100. return parse_tags (bbdecode ($this->notes));
  101. } else {
  102. return bbdecode ($this->notes);
  103. }
  104. }
  105. }
  106. public function lastUpdate ($raw = false) {
  107. if ($raw) {
  108. return $this->lastUpdate;
  109. } else {
  110. return timestamptodate ($this->lastUpdate);
  111. }
  112. }
  113. public function _id ($value) {
  114. $this->id = $value;
  115. }
  116. public function _guid ($value) {
  117. $this->guid = $value;
  118. }
  119. public function _title ($value) {
  120. $this->title = $value;
  121. }
  122. public function _author ($value) {
  123. $this->author = $value;
  124. }
  125. public function _content ($value) {
  126. $this->content = $value;
  127. }
  128. public function _link ($value) {
  129. $this->link = $value;
  130. }
  131. public function _date ($value) {
  132. if (is_int (intval ($value))) {
  133. $this->date = $value;
  134. } else {
  135. $this->date = time ();
  136. }
  137. }
  138. public function _isRead ($value) {
  139. $this->is_read = $value;
  140. }
  141. public function _isFavorite ($value) {
  142. $this->is_favorite = $value;
  143. }
  144. public function _isPublic ($value) {
  145. $this->is_public = $value;
  146. }
  147. public function _feed ($value) {
  148. $this->feed = $value;
  149. }
  150. public function _tags ($value) {
  151. if (!is_array ($value)) {
  152. $value = array ($value);
  153. }
  154. foreach ($value as $key => $t) {
  155. if (!$t) {
  156. unset ($value[$key]);
  157. }
  158. }
  159. $this->tags = $value;
  160. }
  161. public function _notes ($value) {
  162. $this->notes = $value;
  163. }
  164. public function _lastUpdate ($value) {
  165. if (is_int (intval ($value))) {
  166. $this->lastUpdate = $value;
  167. } else {
  168. $this->lastUpdate = $this->date (true);
  169. }
  170. }
  171. public function isDay ($day) {
  172. $date = getdate ();
  173. $today = mktime (0, 0, 0, $date['mon'], $date['mday'], $date['year']);
  174. $yesterday = $today - 86400;
  175. if ($day == Days::TODAY &&
  176. $this->date >= $today && $this->date < $today + 86400) {
  177. return true;
  178. } elseif ($day == Days::YESTERDAY &&
  179. $this->date >= $yesterday && $this->date < $yesterday + 86400) {
  180. return true;
  181. } elseif ($day == Days::BEFORE_YESTERDAY && $this->date < $yesterday) {
  182. return true;
  183. } else {
  184. return false;
  185. }
  186. }
  187. public function toArray () {
  188. return array (
  189. 'id' => $this->id (),
  190. 'guid' => $this->guid (),
  191. 'title' => $this->title (),
  192. 'author' => $this->author (),
  193. 'content' => $this->content (),
  194. 'link' => $this->link (),
  195. 'date' => $this->date (true),
  196. 'is_read' => $this->isRead (),
  197. 'is_favorite' => $this->isFavorite (),
  198. 'is_public' => $this->isPublic (),
  199. 'id_feed' => $this->feed (),
  200. 'lastUpdate' => $this->lastUpdate (true),
  201. 'tags' => $this->tags (true),
  202. 'annotation' => $this->notes ()
  203. );
  204. }
  205. }
  206. class EntryDAO extends Model_pdo {
  207. public function addEntry ($valuesTmp) {
  208. $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, lastUpdate, tags) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
  209. $stm = $this->bd->prepare ($sql);
  210. $values = array (
  211. $valuesTmp['id'],
  212. $valuesTmp['guid'],
  213. $valuesTmp['title'],
  214. $valuesTmp['author'],
  215. base64_encode (gzdeflate (serialize ($valuesTmp['content']))),
  216. $valuesTmp['link'],
  217. $valuesTmp['date'],
  218. $valuesTmp['is_read'],
  219. $valuesTmp['is_favorite'],
  220. $valuesTmp['is_public'],
  221. $valuesTmp['id_feed'],
  222. $valuesTmp['lastUpdate'],
  223. $valuesTmp['tags'],
  224. );
  225. if ($stm && $stm->execute ($values)) {
  226. return true;
  227. } else {
  228. $info = $stm->errorInfo();
  229. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  230. return false;
  231. }
  232. }
  233. public function updateEntry ($id, $valuesTmp) {
  234. if (isset ($valuesTmp['content'])) {
  235. $valuesTmp['content'] = base64_encode (gzdeflate (serialize ($valuesTmp['content'])));
  236. }
  237. $set = '';
  238. foreach ($valuesTmp as $key => $v) {
  239. $set .= $key . '=?, ';
  240. }
  241. $set = substr ($set, 0, -2);
  242. $sql = 'UPDATE entry SET ' . $set . ' WHERE id=?';
  243. $stm = $this->bd->prepare ($sql);
  244. foreach ($valuesTmp as $v) {
  245. $values[] = $v;
  246. }
  247. $values[] = $id;
  248. if ($stm && $stm->execute ($values)) {
  249. return true;
  250. } else {
  251. $info = $stm->errorInfo();
  252. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  253. return false;
  254. }
  255. }
  256. public function markReadEntries ($read, $dateMax) {
  257. $sql = 'UPDATE entry e INNER JOIN feed f ON e.id_feed = f.id SET is_read = ? WHERE date < ? AND priority > 0';
  258. $stm = $this->bd->prepare ($sql);
  259. $values = array ($read, $dateMax);
  260. if ($stm && $stm->execute ($values)) {
  261. return true;
  262. } else {
  263. $info = $stm->errorInfo();
  264. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  265. return false;
  266. }
  267. }
  268. public function markReadCat ($id, $read, $dateMax) {
  269. $sql = 'UPDATE entry e INNER JOIN feed f ON e.id_feed = f.id SET is_read = ? WHERE category = ? AND date < ?';
  270. $stm = $this->bd->prepare ($sql);
  271. $values = array ($read, $id, $dateMax);
  272. if ($stm && $stm->execute ($values)) {
  273. return true;
  274. } else {
  275. $info = $stm->errorInfo();
  276. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  277. return false;
  278. }
  279. }
  280. public function markReadFeed ($id, $read, $dateMax) {
  281. $sql = 'UPDATE entry SET is_read = ? WHERE id_feed = ? AND date < ?';
  282. $stm = $this->bd->prepare ($sql);
  283. $values = array ($read, $id, $dateMax);
  284. if ($stm && $stm->execute ($values)) {
  285. return true;
  286. } else {
  287. $info = $stm->errorInfo();
  288. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  289. return false;
  290. }
  291. }
  292. public function updateEntries ($valuesTmp) {
  293. if (isset ($valuesTmp['content'])) {
  294. $valuesTmp['content'] = base64_encode (gzdeflate (serialize ($valuesTmp['content'])));
  295. }
  296. $set = '';
  297. foreach ($valuesTmp as $key => $v) {
  298. $set .= $key . '=?, ';
  299. }
  300. $set = substr ($set, 0, -2);
  301. $sql = 'UPDATE entry SET ' . $set;
  302. $stm = $this->bd->prepare ($sql);
  303. foreach ($valuesTmp as $v) {
  304. $values[] = $v;
  305. }
  306. if ($stm && $stm->execute ($values)) {
  307. return true;
  308. } else {
  309. $info = $stm->errorInfo();
  310. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  311. return false;
  312. }
  313. }
  314. public function cleanOldEntries ($nb_month) {
  315. $date = 60 * 60 * 24 * 30 * $nb_month;
  316. $sql = 'DELETE FROM entry WHERE date <= ? AND is_favorite = 0 AND annotation = ""';
  317. $stm = $this->bd->prepare ($sql);
  318. $values = array (
  319. time () - $date
  320. );
  321. if ($stm && $stm->execute ($values)) {
  322. return true;
  323. } else {
  324. $info = $stm->errorInfo();
  325. Log::record ('SQL error : ' . $info[2], Log::ERROR);
  326. return false;
  327. }
  328. }
  329. public function searchById ($id) {
  330. $sql = 'SELECT * FROM entry WHERE id=?';
  331. $stm = $this->bd->prepare ($sql);
  332. $values = array ($id);
  333. $stm->execute ($values);
  334. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  335. $entry = HelperEntry::daoToEntry ($res);
  336. if (isset ($entry[0])) {
  337. return $entry[0];
  338. } else {
  339. return false;
  340. }
  341. }
  342. public function listEntries ($mode, $search = false, $order = 'high_to_low') {
  343. $where = ' WHERE priority > 0';
  344. if ($mode == 'not_read') {
  345. $where .= ' AND is_read=0';
  346. }
  347. $values = array();
  348. if ($search) {
  349. $values[] = '%'.$search.'%';
  350. $where .= ' AND title LIKE ?';
  351. }
  352. if ($order == 'low_to_high') {
  353. $order = ' DESC';
  354. } else {
  355. $order = '';
  356. }
  357. $sql = 'SELECT COUNT(*) AS count FROM entry e INNER JOIN feed f ON e.id_feed = f.id' . $where;
  358. $stm = $this->bd->prepare ($sql);
  359. $stm->execute ($values);
  360. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  361. $this->nbItems = $res[0]['count'];
  362. $deb = ($this->currentPage () - 1) * $this->nbItemsPerPage;
  363. $fin = $this->nbItemsPerPage;
  364. $sql = 'SELECT e.* FROM entry e'
  365. . ' INNER JOIN feed f ON e.id_feed = f.id' . $where
  366. . ' ORDER BY date' . $order
  367. . ' LIMIT ' . $deb . ', ' . $fin;
  368. $stm = $this->bd->prepare ($sql);
  369. $stm->execute ($values);
  370. return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
  371. }
  372. public function listFavorites ($mode, $search = false, $order = 'high_to_low') {
  373. $where = ' WHERE is_favorite=1';
  374. if ($mode == 'not_read') {
  375. $where .= ' AND is_read=0';
  376. }
  377. $values = array();
  378. if ($search) {
  379. $values[] = '%'.$search.'%';
  380. $where .= ' AND title LIKE ?';
  381. }
  382. if ($order == 'low_to_high') {
  383. $order = ' DESC';
  384. } else {
  385. $order = '';
  386. }
  387. $sql = 'SELECT COUNT(*) AS count FROM entry' . $where;
  388. $stm = $this->bd->prepare ($sql);
  389. $stm->execute ($values);
  390. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  391. $this->nbItems = $res[0]['count'];
  392. if($this->nbItemsPerPage < 0) {
  393. $sql = 'SELECT * FROM entry' . $where
  394. . ' ORDER BY date' . $order;
  395. } else {
  396. $deb = ($this->currentPage () - 1) * $this->nbItemsPerPage;
  397. $fin = $this->nbItemsPerPage;
  398. $sql = 'SELECT * FROM entry' . $where
  399. . ' ORDER BY date' . $order
  400. . ' LIMIT ' . $deb . ', ' . $fin;
  401. }
  402. $stm = $this->bd->prepare ($sql);
  403. $stm->execute ($values);
  404. return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
  405. }
  406. public function listPublic ($mode, $search = false, $order = 'high_to_low') {
  407. $where = ' WHERE is_public=1';
  408. if ($mode == 'not_read') {
  409. $where .= ' AND is_read=0';
  410. }
  411. $values = array();
  412. if ($search) {
  413. $values[] = '%'.$search.'%';
  414. $where .= ' AND title LIKE ?';
  415. }
  416. if ($order == 'low_to_high') {
  417. $order = ' DESC';
  418. } else {
  419. $order = '';
  420. }
  421. $sql = 'SELECT COUNT(*) AS count FROM entry' . $where;
  422. $stm = $this->bd->prepare ($sql);
  423. $stm->execute ($values);
  424. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  425. $this->nbItems = $res[0]['count'];
  426. if($this->nbItemsPerPage < 0) {
  427. $sql = 'SELECT * FROM entry' . $where
  428. . ' ORDER BY date' . $order;
  429. } else {
  430. $deb = ($this->currentPage () - 1) * $this->nbItemsPerPage;
  431. $fin = $this->nbItemsPerPage;
  432. $sql = 'SELECT * FROM entry' . $where
  433. . ' ORDER BY date' . $order
  434. . ' LIMIT ' . $deb . ', ' . $fin;
  435. }
  436. $stm = $this->bd->prepare ($sql);
  437. $stm->execute ($values);
  438. return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
  439. }
  440. public function listByCategory ($cat, $mode, $search = false, $order = 'high_to_low') {
  441. $where = ' WHERE category=?';
  442. if ($mode == 'not_read') {
  443. $where .= ' AND is_read=0';
  444. }
  445. $values = array ($cat);
  446. if ($search) {
  447. $values[] = '%'.$search.'%';
  448. $where .= ' AND title LIKE ?';
  449. }
  450. if ($order == 'low_to_high') {
  451. $order = ' DESC';
  452. } else {
  453. $order = '';
  454. }
  455. $sql = 'SELECT COUNT(*) AS count FROM entry e INNER JOIN feed f ON e.id_feed = f.id' . $where;
  456. $stm = $this->bd->prepare ($sql);
  457. $stm->execute ($values);
  458. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  459. $this->nbItems = $res[0]['count'];
  460. $deb = ($this->currentPage () - 1) * $this->nbItemsPerPage;
  461. $fin = $this->nbItemsPerPage;
  462. $sql = 'SELECT e.* FROM entry e INNER JOIN feed f ON e.id_feed = f.id' . $where
  463. . ' ORDER BY date' . $order
  464. . ' LIMIT ' . $deb . ', ' . $fin;
  465. $stm = $this->bd->prepare ($sql);
  466. $stm->execute ($values);
  467. return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
  468. }
  469. public function listByFeed ($feed, $mode, $search = false, $order = 'high_to_low') {
  470. $where = ' WHERE id_feed=?';
  471. if ($mode == 'not_read') {
  472. $where .= ' AND is_read=0';
  473. }
  474. $values = array($feed);
  475. if ($search) {
  476. $values[] = '%'.$search.'%';
  477. $where .= ' AND title LIKE ?';
  478. }
  479. if ($order == 'low_to_high') {
  480. $order = ' DESC';
  481. } else {
  482. $order = '';
  483. }
  484. $sql = 'SELECT COUNT(*) AS count FROM entry' . $where;
  485. $stm = $this->bd->prepare ($sql);
  486. $stm->execute ($values);
  487. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  488. $this->nbItems = $res[0]['count'];
  489. $deb = ($this->currentPage () - 1) * $this->nbItemsPerPage;
  490. $fin = $this->nbItemsPerPage;
  491. $sql = 'SELECT * FROM entry e' . $where
  492. . ' ORDER BY date' . $order
  493. . ' LIMIT ' . $deb . ', ' . $fin;
  494. $stm = $this->bd->prepare ($sql);
  495. $stm->execute ($values);
  496. return HelperEntry::daoToEntry ($stm->fetchAll (PDO::FETCH_ASSOC));
  497. }
  498. public function count () {
  499. $sql = 'SELECT COUNT(*) AS count FROM entry e INNER JOIN feed f ON e.id_feed = f.id WHERE priority > 0';
  500. $stm = $this->bd->prepare ($sql);
  501. $stm->execute ();
  502. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  503. return $res[0]['count'];
  504. }
  505. public function countNotRead () {
  506. $sql = 'SELECT COUNT(*) AS count FROM entry e INNER JOIN feed f ON e.id_feed = f.id WHERE is_read=0 AND priority > 0';
  507. $stm = $this->bd->prepare ($sql);
  508. $stm->execute ();
  509. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  510. return $res[0]['count'];
  511. }
  512. public function countNotReadByFeed ($id) {
  513. $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_read = 0 AND id_feed = ?';
  514. $stm = $this->bd->prepare ($sql);
  515. $stm->execute (array ($id));
  516. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  517. return $res[0]['count'];
  518. }
  519. public function countNotReadByCat ($id) {
  520. $sql = 'SELECT COUNT(*) AS count FROM entry e INNER JOIN feed f ON e.id_feed = f.id WHERE is_read=0 AND category = ?';
  521. $stm = $this->bd->prepare ($sql);
  522. $stm->execute (array ($id));
  523. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  524. return $res[0]['count'];
  525. }
  526. public function countNotReadFavorites () {
  527. $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_read=0 AND is_favorite=1';
  528. $stm = $this->bd->prepare ($sql);
  529. $stm->execute ();
  530. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  531. return $res[0]['count'];
  532. }
  533. public function countFavorites () {
  534. $sql = 'SELECT COUNT(*) AS count FROM entry WHERE is_favorite=1';
  535. $stm = $this->bd->prepare ($sql);
  536. $stm->execute ();
  537. $res = $stm->fetchAll (PDO::FETCH_ASSOC);
  538. return $res[0]['count'];
  539. }
  540. // gestion de la pagination directement via le DAO
  541. private $nbItemsPerPage = 1;
  542. private $currentPage = 1;
  543. private $nbItems = 0;
  544. public function _nbItemsPerPage ($value) {
  545. $this->nbItemsPerPage = $value;
  546. }
  547. public function _currentPage ($value) {
  548. $this->currentPage = $value;
  549. }
  550. public function currentPage () {
  551. if ($this->currentPage < 1) {
  552. return 1;
  553. }
  554. $maxPage = ceil ($this->nbItems / $this->nbItemsPerPage);
  555. if ($this->currentPage > $maxPage) {
  556. return $maxPage;
  557. }
  558. return $this->currentPage;
  559. }
  560. public function getPaginator ($entries) {
  561. $paginator = new Paginator ($entries);
  562. $paginator->_nbItems ($this->nbItems);
  563. $paginator->_nbItemsPerPage ($this->nbItemsPerPage);
  564. $paginator->_currentPage ($this->currentPage ());
  565. return $paginator;
  566. }
  567. }
  568. class HelperEntry {
  569. public static function daoToEntry ($listDAO, $mode = 'all', $favorite = false) {
  570. $list = array ();
  571. if (!is_array ($listDAO)) {
  572. $listDAO = array ($listDAO);
  573. }
  574. foreach ($listDAO as $key => $dao) {
  575. $list[$key] = new Entry (
  576. $dao['id_feed'],
  577. $dao['guid'],
  578. $dao['title'],
  579. $dao['author'],
  580. unserialize (gzinflate (base64_decode ($dao['content']))),
  581. $dao['link'],
  582. $dao['date'],
  583. $dao['is_read'],
  584. $dao['is_favorite'],
  585. $dao['is_public']
  586. );
  587. $tags = preg_split('/[\s#]/', $dao['tags']);
  588. $list[$key]->_notes ($dao['annotation']);
  589. $list[$key]->_lastUpdate ($dao['lastUpdate']);
  590. $list[$key]->_tags ($tags);
  591. if (isset ($dao['id'])) {
  592. $list[$key]->_id ($dao['id']);
  593. }
  594. }
  595. return $list;
  596. }
  597. }