'array', 'result_data' => 'array', 'category_ids' => 'array', ]; /** * [getStatusTextAttr] * * @Author: Yeshihao * @DateTime: 2024/11/28 10:06 * @param $value * @param $data * @return string */ public function getStatusTextAttr($value, $data) { $arr = [10 => '待审核', 20 => '审核通过', 30 => '审核失败']; return $arr[$data['status']] ?? ''; } /** * [store] * 提交人 * * @Author: Yeshihao * @DateTime: 2024/11/27 18:33 * @return \think\model\relation\BelongsTo */ public function storeUser() { return $this->belongsTo(User::class, 'store_user_id', 'store_user_id'); } /** * [apply] * 申请人 * * @Author: Yeshihao * @DateTime: 2024/11/27 18:33 * @return \think\model\relation\BelongsTo */ public function applyUser() { return $this->belongsTo(User::class, 'apply_user_id', 'store_user_id'); } /** * 文章详情 * * @param $id * @return null|static * @throws \think\exception\DbException */ public static function detail($id) { return self::get($id); } /** * 软删除 * * @return false|int */ public function setDelete() { return $this->save(['is_delete' => 1]); } }