update thống kê
This commit is contained in:
@@ -41,22 +41,33 @@ class Logs extends \yii\db\ActiveRecord {
|
||||
public function attributeLabels() {
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'staff_id' => 'Staff ID',
|
||||
'card_number' => 'card_number',
|
||||
'device_id' => 'Device ID',
|
||||
'door_id' => 'Door ID',
|
||||
'in_out_state' => 'In Out State',
|
||||
'time' => 'Time',
|
||||
'event_type' => 'Event Type',
|
||||
'staff_id' => 'Mã nhân viên',
|
||||
'card_number' => 'Mã thẻ',
|
||||
'device_id' => 'Thiết bị',
|
||||
'door_id' => 'Cửa',
|
||||
'in_out_state' => 'Trạng thái vào/ra',
|
||||
'time' => 'Thời gian',
|
||||
'event_type' => 'Mô tả sự kiện',
|
||||
'staff_name' => 'Tên nhân viên',
|
||||
'staff_department' => 'Phòng ban',
|
||||
];
|
||||
}
|
||||
|
||||
public static $stateArray = [
|
||||
0 => "Vào",
|
||||
1 => "Ra"
|
||||
];
|
||||
|
||||
public function multiCreate($datas) {
|
||||
$field = ['staff_id', 'card_number', 'device_id', 'door_id', 'in_out_state', 'time', 'event_type'];
|
||||
static::getDb()->createCommand()->batchInsert($this->tableName(), $field, $datas)->execute();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getStaff() {
|
||||
return $this->hasOne(Staff::className(), ["id" => "staff_id"]);
|
||||
}
|
||||
|
||||
public static function parseTime($time) {
|
||||
$temp = intval($time);
|
||||
$second = $temp % 60;
|
||||
|
||||
Reference in New Issue
Block a user