소스 검색

修复资质列表

yeshihao 1 년 전
부모
커밋
1ead0b8251
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      dyu/application/task/controller/Test.php

+ 12 - 0
dyu/application/task/controller/Test.php

@@ -3,6 +3,7 @@
 namespace app\task\controller;
 
 use TCPDF;
+use app\common\model\Certificate;
 
 class Test
 {
@@ -74,4 +75,15 @@ class Test
 		// 输出PDF
 		$pdf->Output('AA.pdf', 'I');
 	}
+
+	public function repairTask()
+	{
+		$model = new Certificate();
+		$list  = $model->with(['file', 'category'])
+			->where('is_delete', '=', 0)->select();
+		return $list->each(function ($item) {
+			$item['file_type'] = $item->file['file_type'];
+			$item->save();
+		});
+	}
 }