['project_id', 'material_id', 'budget_type'], ]; } /** * @notes 获取材料预算列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/01/08 16:30 */ public function lists(): array { return ProjectMaterialBudget::where($this->searchWhere) ->field(['id', 'project_id', 'material_id', 'budget_type', 'num', 'price', 'amount', 'remark']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取材料预算数量 * @return int * @author likeadmin * @date 2024/01/08 16:30 */ public function count(): int { return ProjectMaterialBudget::where($this->searchWhere)->count(); } }