CollectionModel.php 745 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\index\model\activity;
  3. use app\index\model\BaseModel;
  4. class CollectionModel extends BaseModel
  5. {
  6. protected $table='collection';
  7. protected $connection = 'db_activity';
  8. /**
  9. * 用户活动收藏
  10. * @param $where
  11. * @param string $order
  12. * @param int $limit
  13. * @return array|false|\PDOStatement|string|\think\Model
  14. */
  15. public function getActivityCollection($where,$order='add_time desc',$limit=50){
  16. return $this->field('collection.*,activity.activity_img,activity.title,activity.show_param')
  17. ->join('activity','activity.activity_id=collection.activity_id','LEFT')
  18. ->where($where)
  19. ->order($order)
  20. ->limit($limit)->select();
  21. }
  22. }