order(['create_time' => 'asc'])->select(); } /** * 获取列表 * @return \think\Paginator * @throws \think\exception\DbException */ public function getList() { return $this->order(['create_time' => 'asc']) ->paginate(15, false, [ 'query' => Request::instance()->request() ]); } /** * 扣减记录详情 * @param $deduct_id * @return null|static * @throws \think\exception\DbException */ public static function detail($deduct_id) { return self::get($deduct_id); } /** * 获取抵扣总金额 * @param array $filter * @return int|string */ public function getDeductTotalMoneyCustom($filter = []) { return $this->where($filter) ->sum('money'); } }