update database
This commit is contained in:
parent
ee3c869d71
commit
24e3347d43
|
@ -70,7 +70,8 @@ class ApiController extends Controller {
|
||||||
$model->create([
|
$model->create([
|
||||||
"Staff" => $post["id"],
|
"Staff" => $post["id"],
|
||||||
"Time" => $time,
|
"Time" => $time,
|
||||||
"Image" => $fileName
|
"Image" => $fileName,
|
||||||
|
"Confidence" => $post["confidence"]
|
||||||
]);
|
]);
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
return ["status" => "success"];
|
return ["status" => "success"];
|
||||||
|
|
|
@ -13,6 +13,7 @@ use Yii;
|
||||||
* @property string $image
|
* @property string $image
|
||||||
* @property int $status
|
* @property int $status
|
||||||
* @property string $remark
|
* @property string $remark
|
||||||
|
* @property string $confidence
|
||||||
*/
|
*/
|
||||||
class CaptureLogs extends \yii\db\ActiveRecord {
|
class CaptureLogs extends \yii\db\ActiveRecord {
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ class CaptureLogs extends \yii\db\ActiveRecord {
|
||||||
public function rules() {
|
public function rules() {
|
||||||
return [
|
return [
|
||||||
[['staff_id', 'time', 'status'], 'integer'],
|
[['staff_id', 'time', 'status'], 'integer'],
|
||||||
[['image', 'remark'], 'string'],
|
[['image', 'remark', 'confidence'], 'string'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +45,8 @@ class CaptureLogs extends \yii\db\ActiveRecord {
|
||||||
'status' => 'Status',
|
'status' => 'Status',
|
||||||
'remark' => 'Remark',
|
'remark' => 'Remark',
|
||||||
'staff_name' => "Name",
|
'staff_name' => "Name",
|
||||||
'staff_image' => "Registration Image"
|
'staff_image' => "Registration Image",
|
||||||
|
'confidence' => 'Confidence'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +56,8 @@ class CaptureLogs extends \yii\db\ActiveRecord {
|
||||||
'time' => $data['Time'],
|
'time' => $data['Time'],
|
||||||
'image' => $data["Image"],
|
'image' => $data["Image"],
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
'remark' => ''
|
'remark' => '',
|
||||||
|
'confidence' => $data["Confidence"]
|
||||||
], '');
|
], '');
|
||||||
if ($r) {
|
if ($r) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -8,6 +8,7 @@ use Yii;
|
||||||
* This is the model class for table "list_management".
|
* This is the model class for table "list_management".
|
||||||
*
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
|
* @property int $code
|
||||||
* @property string $type
|
* @property string $type
|
||||||
* @property string $name
|
* @property string $name
|
||||||
* @property string $image
|
* @property string $image
|
||||||
|
@ -16,6 +17,7 @@ use Yii;
|
||||||
* @property string $telephone
|
* @property string $telephone
|
||||||
* @property string $address
|
* @property string $address
|
||||||
* @property int $time
|
* @property int $time
|
||||||
|
* @property int $last_modified
|
||||||
*/
|
*/
|
||||||
class ListManagement extends \yii\db\ActiveRecord {
|
class ListManagement extends \yii\db\ActiveRecord {
|
||||||
|
|
||||||
|
@ -32,7 +34,7 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||||
public function rules() {
|
public function rules() {
|
||||||
return [
|
return [
|
||||||
[['type', 'name', 'gender', 'telephone', 'address', 'image'], 'string'],
|
[['type', 'name', 'gender', 'telephone', 'address', 'image'], 'string'],
|
||||||
[['birthday', 'time'], 'integer'],
|
[['birthday', 'time', 'code', 'last_modified'], 'integer'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +44,7 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||||
public function attributeLabels() {
|
public function attributeLabels() {
|
||||||
return [
|
return [
|
||||||
'id' => 'ID',
|
'id' => 'ID',
|
||||||
|
'code' => 'Code',
|
||||||
'type' => 'Type',
|
'type' => 'Type',
|
||||||
'name' => 'Name',
|
'name' => 'Name',
|
||||||
'image' => 'Registration Image',
|
'image' => 'Registration Image',
|
||||||
|
@ -49,12 +52,14 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||||
'birthday' => 'Birthday',
|
'birthday' => 'Birthday',
|
||||||
'telephone' => 'Telephone',
|
'telephone' => 'Telephone',
|
||||||
'address' => 'Address',
|
'address' => 'Address',
|
||||||
'time' => 'Registration time'
|
'time' => 'Registration time',
|
||||||
|
'last_modified' => 'Last Modified'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create($data) {
|
public function create($data) {
|
||||||
$r = $this->load([
|
$r = $this->load([
|
||||||
|
'code' => $data['Code'],
|
||||||
'type' => $data['type'],
|
'type' => $data['type'],
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'image' => $data['image'],
|
'image' => $data['image'],
|
||||||
|
@ -62,7 +67,8 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||||
'birthday' => $data['birthday'] === "" ? 0 : date_format(date_create_from_format('d/m/Y', $data['birthday']), 'U'),
|
'birthday' => $data['birthday'] === "" ? 0 : date_format(date_create_from_format('d/m/Y', $data['birthday']), 'U'),
|
||||||
'telephone' => $data['telephone'],
|
'telephone' => $data['telephone'],
|
||||||
'address' => $data['address'],
|
'address' => $data['address'],
|
||||||
'time' => time()
|
'time' => time(),
|
||||||
|
'last_modified' => time()
|
||||||
], '');
|
], '');
|
||||||
if ($r) {
|
if ($r) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user