Money_prize.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. *------Create thems Model------
  4. *------SCWPHP Version 1.0.0------
  5. *------Dev Model Jions------
  6. *------Create Time 2019-04-15 16:05:26------
  7. */
  8. namespace App\Commons\Model;
  9. use \System\Model;
  10. class Money_prize extends Model {
  11. // 对象表
  12. protected $table = 'money_prize';
  13. public $timestamps = false;
  14. /**
  15. * 中奖记录
  16. *
  17. * @access public
  18. * @param mixed $prizeRecordWhere 查询条件
  19. * @param mixed $prizeRecordBetween 查询条件区间
  20. * @param mixed $begin 起始查询位置
  21. * @param mixed $pageSize 分页大小
  22. * @param mixed $orderBy 排序字段
  23. * @return array JsonString
  24. */
  25. public function prizeRecord($prizeRecordWhere, $prizeRecordBetween, $begin, $pageSize, $orderBy = 'money_time') {
  26. $result = $this
  27. //-> join('article','money_prize.info_identity','=','article.identity')
  28. -> where($prizeRecordWhere)
  29. -> whereBetween('money_time', $prizeRecordBetween)
  30. -> offset($begin)
  31. -> limit($pageSize)
  32. -> orderBy($orderBy)
  33. -> get();
  34. return $result;
  35. }
  36. /**
  37. * 中奖记录总数
  38. *
  39. * @access public
  40. * @param mixed $prizeRecordWhere 查询条件
  41. * @param mixed $prizeRecordBetween 查询条件区间
  42. * @return array JsonString
  43. */
  44. public function prizeRecordTotal($prizeRecordWhere, $prizeRecordBetween) {
  45. $result = $this
  46. -> where($prizeRecordWhere)
  47. -> whereBetween('money_time', $prizeRecordBetween)
  48. -> count();
  49. return $result;
  50. }
  51. }