added print files view and delete

This commit is contained in:
franknstayn
2020-03-14 20:41:41 +08:00
parent 8685f93b29
commit 5f05c34167
6 changed files with 173 additions and 9 deletions

View File

@@ -463,4 +463,31 @@ class AdminModel extends Model
return $i;
}
function selectGroupPrintFiles(){
$i = DB::select("SELECT ppl.TemplateCode, t.TemplateName, s.SportsName, tc.Category
FROM print_pattern_list AS ppl
INNER JOIN templates AS t ON t.TemplateCode = ppl.TemplateCode
INNER JOIN sports AS s ON s.Id = t.SportsId
INNER JOIN template_categories AS tc ON tc.Id = t.Category
GROUP BY ppl.TemplateCode");
return $i;
}
function selectPrintFiles($tempCode){
$i = DB::select("SELECT t.TemplateName, ppl.Id, ppl.Path, ppl.`Type`, ppl.Size from templates AS t
INNER JOIN print_pattern_list AS ppl ON ppl.TemplateCode = t.TemplateCode
WHERE t.TemplateCode = '$tempCode'
ORDER BY ppl.`Type` ASC");
return $i;
}
function deletePrintFiles($id){
$i = DB::table('print_pattern_list')
->where("Id", $id)
->delete();
return $i;
}
}