截流自动化的商城平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Article.php 724B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\common\model\content;
  3. use app\common\basics\Models;
  4. class Article extends Models
  5. {
  6. /**
  7. * @Notes: 关联文章分类模型
  8. * @Author: 张无忌
  9. */
  10. public function category()
  11. {
  12. return $this->hasOne('ArticleCategory', 'id', 'cid');
  13. }
  14. public function setContentAttr($value,$data)
  15. {
  16. $content = $data['content'];
  17. if (!empty($content)) {
  18. $content = HtmlSetImage($content);
  19. }
  20. return $content;
  21. }
  22. public function getContentAttr($value,$data)
  23. {
  24. $content = $data['content'];
  25. if (!empty($content)) {
  26. $content = HtmlGetImage($content);
  27. }
  28. return $content;
  29. }
  30. }