save(['is_delete' => 1]); } /** * [category] * 关联分类 * * @Author: Yeshihao * @DateTime: 2024/11/26 14:38 * @return \think\model\relation\BelongsTo */ public function category() { return $this->belongsTo(CertificateCategory::class, 'certificate_category_id', 'id'); } /** * [file] * 关联文件 * * @Author: Yeshihao * @DateTime: 2024/11/26 14:48 * @return \think\model\relation\BelongsTo */ public function file() { return $this->belongsTo('UploadFile', 'file_id', 'file_id') ->bind(['file_path', 'file_name', 'file_url']); } /** * [getCertificateList] * * @Author: Yeshihao * @DateTime: 2024/11/27 10:43 * @param array $where * @param string $field * @return bool|\PDOStatement|string|\think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public static function getCertificateList($where = [], $field = '*') { $model = new static; !empty($where) && $model->where($where); return $model->field($field)->where('is_delete', '=', 0)->select(); } }