update
This commit is contained in:
@@ -38,8 +38,14 @@ class ApiController extends Controller {
|
||||
public function actionSyncUrl() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->bodyParams;
|
||||
$model = new \app\models\FaceLogs();
|
||||
$model->create($post);
|
||||
$sync = \app\models\SyncUrl::find()->one();
|
||||
if ($sync) {
|
||||
$sync->data = $post['url'];
|
||||
$sync->save();
|
||||
} else {
|
||||
$model = new \app\models\SyncUrl();
|
||||
$model->create($post);
|
||||
}
|
||||
Yii::$app->response->format = "json";
|
||||
return ["stt" => true];
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class DashboardController extends Controller {
|
||||
$this->view->title = "Bảng tổng hợp";
|
||||
$searchModel = new FaceLogsSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
|
||||
Reference in New Issue
Block a user