userId]; if (isset($this->params['change_object']) && $this->params['change_object'] != '') { $where[] = ['change_object','=',$this->params['change_object']]; }else { $where[] = ['change_object','=',AccountLogEnum::MONEY]; } if (isset($this->params['action']) && $this->params['action'] != '') { $where[] = ['action','=',$this->params['action']]; } return $where; } /** * @notes 账户明细列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author ljj * @date 2022/6/9 10:21 上午 */ public function lists(): array { $lists = AccountLog::field('id,change_amount,change_type,remark,create_time,action') ->append(['change_type_desc']) ->where(self::where()) ->limit($this->limitOffset, $this->limitLength) ->order('id','desc') ->select() ->toArray(); return $lists; } /** * @notes 账户明细数量 * @return int * @author ljj * @date 2022/6/9 10:21 上午 */ public function count(): int { return AccountLog::where(self::where())->count(); } }