diff --git a/controllers/ApiController.php b/controllers/ApiController.php index af5cceb6..35030d53 100644 --- a/controllers/ApiController.php +++ b/controllers/ApiController.php @@ -89,7 +89,7 @@ class ApiController extends Controller { } $allFeatures[] = [ "id" => $value->id, - "name" => $value->name, + "name" => $value->code, "features" => $f ]; } diff --git a/controllers/ListManagementController.php b/controllers/ListManagementController.php index c6bc8eb7..9c440618 100644 --- a/controllers/ListManagementController.php +++ b/controllers/ListManagementController.php @@ -336,19 +336,18 @@ class ListManagementController extends Controller { ]), true); $ft[] = ["url" => $fileName, "features" => $features['results'][0]['feature']]; } - $model = ListManagement::findOne(['code' => $data['idStaff']]); if ($model) { - $model->name = $data['code']; + $model->name = $data['name']; $model->image = json_encode($ft); $model->last_modified = time(); $model->save(); } else { $model = new ListManagement(); $model->create([ - 'code' => $data['idStaff'], + 'code' => strval($data['idStaff']), 'type' => "wl", - 'name' => $data['code'], + 'name' => $data['name'], 'image' => json_encode($ft), 'gender' => "", 'birthday' => "", diff --git a/db/app.db b/db/app.db index b1205d58..562c876d 100644 Binary files a/db/app.db and b/db/app.db differ diff --git a/models/ListManagement.php b/models/ListManagement.php index 8013b889..7d1984d2 100644 --- a/models/ListManagement.php +++ b/models/ListManagement.php @@ -8,7 +8,7 @@ use Yii; * This is the model class for table "list_management". * * @property int $id - * @property int $code + * @property string $code * @property string $type * @property string $name * @property string $image @@ -33,8 +33,8 @@ class ListManagement extends \yii\db\ActiveRecord { */ public function rules() { return [ - [['type', 'name', 'gender', 'telephone', 'address', 'image'], 'string'], - [['birthday', 'time', 'code', 'last_modified'], 'integer'], + [['type', 'name', 'gender', 'telephone', 'address', 'image', 'code'], 'string'], + [['birthday', 'time', 'last_modified'], 'integer'], ]; } @@ -44,7 +44,7 @@ class ListManagement extends \yii\db\ActiveRecord { public function attributeLabels() { return [ 'id' => 'ID', - 'code' => 'Code', + 'code' => 'ID', 'type' => 'Type', 'name' => 'Name', 'image' => 'Registration Image', diff --git a/views/capture-logs/index.tpl b/views/capture-logs/index.tpl index 46e3f6b3..b71eb6a5 100644 --- a/views/capture-logs/index.tpl +++ b/views/capture-logs/index.tpl @@ -97,9 +97,9 @@