Money_buy_str.php 1.6 KB

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