| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- *------Create thems Model------
- *------SCWPHP Version 1.0.0------
- *------Dev Model Jions------
- *------Create Time 2019-04-15 16:05:26------
- */
- namespace App\Commons\Model;
- use \System\Model;
- class Money_buy_str extends Model {
- // 对象表
- protected $table = 'money_buy_str';
- public $timestamps = false;
- /**
- * 投注记录
- *
- * @access public
- * @param mixed $select 查询字段
- * @param mixed $moneyBuyWhere 查询条件
- * @param mixed $moneyBuyBetween 查询条件区间
- * @param mixed $begin 起始查询位置
- * @param mixed $pageSize 分页大小
- * @param mixed $orderBy 排序字段
- * @return array JsonString
- */
- public function moneyBuyStr($select, $moneyBuyWhere, $moneyBuyBetween, $begin, $pageSize, $orderBy = 'money_time') {
- $result = $this
- -> select($select)
- -> join('st_bet_str','money_buy_str.bet_str_id','=','st_bet_str.id')
- -> where($moneyBuyWhere)
- -> whereBetween('money_time', $moneyBuyBetween)
- -> offset($begin)
- -> limit($pageSize)
- -> orderBy($orderBy)
- -> get();
- return $result;
- }
- /**
- * 投注记录总数
- *
- * @access public
- * @param mixed $moneyBuyWhere 查询条件
- * @param mixed $moneyBuyBetween 查询条件区间
- * @return array JsonString
- */
- public function moneyBuyTotal($moneyBuyWhere, $moneyBuyBetween) {
- $result = $this
- -> where($moneyBuyWhere)
- -> whereBetween('money_time', $moneyBuyBetween)
- -> count();
- return $result;
- }
- }
|