update control logs
This commit is contained in:
@@ -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"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user