心理咨询网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DoModel.php 814B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * @copyright (C)2016-2099 Hnaoyun Inc.
  4. * @author XingMeng
  5. * @email hnxsh@foxmail.com
  6. * @date 2018年3月8日
  7. *
  8. */
  9. namespace app\home\model;
  10. use core\basic\Model;
  11. class DoModel extends Model
  12. {
  13. // 新增访问
  14. public function addVisits($id)
  15. {
  16. $data = array(
  17. 'visits' => '+=1'
  18. );
  19. parent::table('ay_content')->where("id=$id")->update($data);
  20. }
  21. // 新增喜欢
  22. public function addLikes($id)
  23. {
  24. $data = array(
  25. 'likes' => '+=1'
  26. );
  27. parent::table('ay_content')->where("id=$id")->update($data);
  28. }
  29. // 新增喜欢
  30. public function addOppose($id)
  31. {
  32. $data = array(
  33. 'oppose' => '+=1'
  34. );
  35. parent::table('ay_content')->where("id=$id")->update($data);
  36. }
  37. }