| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- /**
- *------Create thems Model------
- *------SCWPHP Version 1.0.0------
- *------Dev Model Jions------
- *------Create Time 2019-04-16 13:05:26------
- */
- namespace App\Commons\Model;
- use \System\Model;
- class Money_record extends Model {
- // 对象表
- protected $table = 'money_details';
- public $timestamps = false;
- /**
- * 盈亏记录
- *
- * @access public
- * @param mixed $moneyRecordSelect 查询参数
- * @param mixed $moneyRecordWhere 查询条件
- * @param mixed $moneyRecordBetween 查询条件区间
- * @param mixed $begin 起始查询位置
- * @param mixed $pageSize 分页大小
- * @param mixed $orderBy 排序字段
- * @return array JsonString
- */
- public function moneyRecord($moneyRecordSelect, $moneyRecordWhere, $moneyRecordBetween, $begin, $pageSize, $orderBy = 'money_time') {
- $result = $this
- -> select($moneyRecordSelect)
- -> where($moneyRecordWhere)
- -> whereBetween('money_time', $moneyRecordBetween)
- -> offset($begin)
- -> limit($pageSize)
- -> orderBy($orderBy)
- -> get();
- return $result;
- }
- /**
- * 盈亏记录总数
- *
- * @access public
- * @param mixed $moneyRecordWhere 查询条件
- * @param mixed $moneyRecordBetween 查询条件区间
- * @return array JsonString
- */
- public function moneyRecordTotal($moneyRecordWhere, $moneyRecordBetween) {
- $result = $this
- -> where($moneyRecordWhere)
- -> whereBetween('money_time', $moneyRecordBetween)
- -> count();
- return $result;
- }
- }
|