select($select) -> where($where) -> orderBy($orderBy, $order) -> first(); return $result; } /** * 提现记录查询 * * @access public * @param mixed $select 查询字段 * @param mixed $where 查询条件 * @param mixed $between 查询区间 demo: ['apply_time' => [2019-04-19 10:46:35, 2019-04-19 10:46:35],'id'=>[99448,99448]]; * @param mixed $begin 起始位置 * @param mixed $pageSize 分页大小 * @param mixed $orderBy 排序 demo: ['apply_time'=>'desc','id'=>'desc'] * @return array JsonString */ public function moneyTake($select, $where = '', $between = '', $begin = '', $pageSize = '', $orderBy = '') { $result = $this -> select($select); if (!empty($where)) { $result = $result -> where($where); } if (!empty($between)) { foreach ($between as $key => $value) { $result = $result -> whereBetween($key, $value); } } if (count($begin) && isset($pageSize)) { $result = $result -> offset($begin) -> limit($pageSize); } if (!empty($orderBy)) { foreach ($orderBy as $key => $value) { $result = $result -> orderBy($key, $value); } } else { $result = $result -> orderBy('apply_time', 'desc'); } $result = $result -> get(); return $result; } /** * 提现记录总数 * * @access public * @param mixed $where 查询条件 * @param mixed $between 查询条件区间 * @return array JsonString */ public function moneyTakeTotal($where, $between) { $result = $this; if (!empty($where)) { $result = $result -> where($where); } if (!empty($between)) { foreach ($between as $key => $value) { $result = $result -> whereBetween($key, $value); } } $result = $result -> count(); return $result; } /** * 添加提现记录 * * @access public * @param mixed $data 添加的字段 * @return array JsonString */ public function insertTake($data) { $result = $this -> insert($data); return $result; } }