PayListModel.php 917 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\common\model;
  3. /**
  4. * 支付记录表
  5. * Class PayListModel
  6. * @package app\common\model
  7. */
  8. class PayListModel extends BaseModel
  9. {
  10. protected $table = 'pay_list';
  11. /**
  12. * 用户支付记录分页
  13. * @param int $page
  14. * @param int $pageSize
  15. * @param array $condition
  16. * @param bool $is_count
  17. * @param string $order
  18. * @return array|int|string
  19. */
  20. public function getPayListPage($page,$pageSize,$condition=[],$is_count = false,$order=''){
  21. $this->alias('a')
  22. ->field('a.*,user.user_name')
  23. ->join('user user','user.user_no = a.user_no','LEFT');
  24. if(!empty($condition)){
  25. $this->where($condition);
  26. }
  27. if(!empty($order)){
  28. $this->order($order);
  29. }
  30. if($is_count){
  31. return $this->count();
  32. }
  33. return $this->page($page,$pageSize)->select();
  34. }
  35. }