PayModel.php 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Author: luzheng.liu
  4. * Time: 2020/12/5 19:52
  5. */
  6. namespace app\api\model;
  7. use app\common\until\Until;
  8. class PayModel extends BaseModel {
  9. protected $table = 'pay_config';
  10. public function getPayList() {
  11. $countModel = $this->alias('p')
  12. ->join('group g','g.id = p.group_id')
  13. ->join('group_role gr', 'gr.group_id = g.id');
  14. $selectModel = $this->alias('p')
  15. ->field('p.*,g.group_name')
  16. ->join('group g','g.id = p.group_id')
  17. ->join('group_role gr', 'gr.group_id = g.id')
  18. ->order(['p.id' => 'des ']);
  19. return $this->joinModelPageList($countModel, $selectModel);
  20. }
  21. public function getPayInfo() {
  22. $selectModel = $this->alias('p')
  23. ->field('p.*')
  24. // ->join('group g','g.id = p.group_id')
  25. ->where($this->getWhere())
  26. ->find();
  27. return Until::modelToArray($selectModel);
  28. }
  29. }