update control logs

This commit is contained in:
2020-12-04 15:13:14 +07:00
parent 3ef04dfb5a
commit 811ed32e04
13 changed files with 282 additions and 36 deletions

View File

@@ -65,14 +65,12 @@ class ApiController extends Controller {
FileHelper::createDirectory($targetPath, 0777);
file_put_contents($targetPath . "/" . $fileName, base64_decode($post['image']));
if ($post["id"] == 0) {
$model = new CaptureLogs();
$model->create([
"Staff" => 0,
"Time" => $time,
"Image" => $fileName
]);
}
$model = new CaptureLogs();
$model->create([
"Staff" => $post["id"],
"Time" => $time,
"Image" => $fileName
]);
Yii::$app->response->format = "json";
return ["status" => "success"];
}