Money_buy.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_buy extends Model {
  11. // 对象表
  12. protected $table = 'money_buy';
  13. public $timestamps = false;
  14. /**
  15. * 投注记录
  16. *
  17. * @access public
  18. * @param mixed $moneyBuyWhere 查询条件
  19. * @param mixed $moneyBuyBetween 查询条件区间
  20. * @param mixed $begin 起始查询位置
  21. * @param mixed $pageSize 分页大小
  22. * @param mixed $orderBy 排序字段
  23. * @return array JsonString
  24. */
  25. public function moneyBuy($moneyBuyWhere, $moneyBuyBetween, $begin, $pageSize, $orderBy = 'money_time') {
  26. $result = $this
  27. -> where($moneyBuyWhere)
  28. -> whereBetween('money_time', $moneyBuyBetween)
  29. -> offset($begin)
  30. -> limit($pageSize)
  31. -> orderBy($orderBy)
  32. -> get();
  33. return $result;
  34. }
  35. /**
  36. * 投注记录总数
  37. *
  38. * @access public
  39. * @param mixed $moneyBuyWhere 查询条件
  40. * @param mixed $moneyBuyBetween 查询条件区间
  41. * @return array JsonString
  42. */
  43. public function moneyBuyTotal($moneyBuyWhere, $moneyBuyBetween) {
  44. $result = $this
  45. -> where($moneyBuyWhere)
  46. -> whereBetween('money_time', $moneyBuyBetween)
  47. -> count();
  48. return $result;
  49. }
  50. }