BookSearchStatService.php 554 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: z-yang
  5. * Date: 2018/12/11
  6. * Time: 10:31
  7. */
  8. namespace App\Modules\Book\Services;
  9. use App\Modules\Book\Models\BookSearchStat;
  10. class BookSearchStatService
  11. {
  12. /**
  13. * 添加统计
  14. * @param $uid
  15. * @param $openid
  16. * @param $type
  17. * @param $content
  18. */
  19. public static function create($uid,$openid,$type,$content){
  20. $type = strtoupper($type);
  21. try{
  22. BookSearchStat::create(compact('uid','openid','type','content'));
  23. }catch (\Exception $e){}
  24. }
  25. }