update biface local

This commit is contained in:
2020-12-01 16:47:43 +07:00
parent 73b44eb2af
commit efb4113001
21 changed files with 883 additions and 57 deletions

View File

@@ -7,44 +7,64 @@ use Yii;
/**
* This is the model class for table "capture_logs".
*
* @property int $ID
* @property int $Time
* @property string $Image
* @property int $Status
* @property string $Remark
* @property int $id
* @property int $time
* @property string $image
* @property int $status
* @property string $remark
*/
class CaptureLogs extends \yii\db\ActiveRecord
{
class CaptureLogs extends \yii\db\ActiveRecord {
/**
* {@inheritdoc}
*/
public static function tableName()
{
public static function tableName() {
return 'capture_logs';
}
/**
* {@inheritdoc}
*/
public function rules()
{
public function rules() {
return [
[['Time', 'Status'], 'integer'],
[['Image', 'Remark'], 'string'],
[['time', 'status'], 'integer'],
[['image', 'remark'], 'string'],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
public function attributeLabels() {
return [
'ID' => 'ID',
'Time' => 'Time',
'Image' => 'Image',
'Status' => 'Status',
'Remark' => 'Remark',
'id' => 'ID',
'time' => 'Time',
'image' => 'Image',
'status' => 'Status',
'remark' => 'Remark',
];
}
public function create($data) {
$r = $this->load([
'time' => $data['Time'],
'image' => $data["Image"],
'status' => 0,
'remark' => ''
], '');
if ($r) {
try {
$this->save();
return $this->id;
} catch (\Exception $ex) {
return false;
}
}
}
public static $statusArray = [
0 => "Unknown",
1 => "List management"
];
}