|
|
@@ -3,6 +3,7 @@ namespace App\Services\Exam;
|
|
|
|
|
|
use App\Models\ExamPaperModel;
|
|
|
use App\Models\ExamTopicModel;
|
|
|
+use App\Models\ActionLogModel;
|
|
|
use App\Services\BaseService;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
@@ -30,7 +31,7 @@ class PaperService extends BaseService
|
|
|
|
|
|
public function customList($params, $pageSize = 15)
|
|
|
{
|
|
|
- $query = $this->model->where('mark', operator: 1);
|
|
|
+ $query = $this->model->where('mark', 1);
|
|
|
|
|
|
if (!empty($params['scene_type'])) {
|
|
|
$query->where('scene_type', $params['scene_type']);
|
|
|
@@ -116,4 +117,16 @@ class PaperService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除七天之前标记软删除的数据
|
|
|
+ */
|
|
|
+ public function delete()
|
|
|
+ {
|
|
|
+ // 设置日志标题
|
|
|
+ ActionLogModel::setRecord(session('userId'), ['type' => 1, 'title' => "删除试卷信息", 'content' => json_encode(request()->post(), 256), 'module' => 'admin']);
|
|
|
+ ActionLogModel::record();
|
|
|
+ $this->model->where('mark', 0)->where('update_time', '<=', time() - 7 * 86400)->delete();
|
|
|
+ return parent::delete();
|
|
|
+ }
|
|
|
+
|
|
|
}
|