update: lấy dữ liệu mã thẻ từ thiết bị, mở cửa từ phần mềm
This commit is contained in:
@@ -12,6 +12,7 @@ use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
use app\models\Device;
|
||||
|
||||
/**
|
||||
* StaffController implements the CRUD actions for Staff model.
|
||||
@@ -79,7 +80,8 @@ class StaffController extends Controller {
|
||||
"model" => $model,
|
||||
"url" => Url::to(["create"]),
|
||||
"departmentArray" => Department::departmentArray(),
|
||||
"genderArray" => Staff::$genderArray
|
||||
"genderArray" => Staff::$genderArray,
|
||||
"deviceArray" => Device::deviceArray()
|
||||
])
|
||||
];
|
||||
}
|
||||
@@ -125,7 +127,8 @@ class StaffController extends Controller {
|
||||
"model" => $model,
|
||||
"url" => Url::to(["update", "id" => $id]),
|
||||
"departmentArray" => Department::departmentArray(),
|
||||
"genderArray" => Staff::$genderArray
|
||||
"genderArray" => Staff::$genderArray,
|
||||
"deviceArray" => Device::deviceArray()
|
||||
])
|
||||
];
|
||||
}
|
||||
@@ -302,4 +305,13 @@ class StaffController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function actionGetRtlog() {
|
||||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->format = "json";
|
||||
$device_id = Yii::$app->request->post("device");
|
||||
$device = Device::findOne($device_id);
|
||||
return json_decode(common::requestToCardService("/GetRTLog", ["DeviceIP" => $device->ip_address]), true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user