update tính năng thống kê chấm công và xuất dữ liệu chấm công

This commit is contained in:
2020-10-16 17:48:38 +07:00
parent 4ba094ab24
commit 0314fa4158
12 changed files with 425 additions and 5 deletions

View File

@@ -50,6 +50,7 @@ class Logs extends \yii\db\ActiveRecord {
'event_type' => 'Mô tả sự kiện',
'staff_name' => 'Tên nhân viên',
'staff_department' => 'Phòng ban',
'staff_code' => 'Mã nhân viên'
];
}

View File

@@ -14,13 +14,14 @@ class LogsSearch extends Logs {
public $staff_name;
public $staff_department;
public $staff_code;
/**
* {@inheritdoc}
*/
public function rules() {
return [
[['id', 'staff_id', 'device_id', 'in_out_state', 'event_type', 'card_number', 'staff_department'], 'integer'],
[['id', 'staff_id', 'device_id', 'in_out_state', 'event_type', 'card_number', 'staff_department', 'staff_code'], 'integer'],
[['staff_name'], 'safe'],
];
}
@@ -62,6 +63,8 @@ class LogsSearch extends Logs {
$query->andFilterWhere(['LIKE', 'name', $this->staff_name]);
if ($this->staff_department)
$query->andFilterWhere(['department_id' => $this->staff_department]);
if ($this->staff_code)
$query->andFilterWhere(['code' => $this->staff_code]);
// grid filtering conditions
$query->andFilterWhere([

View File

@@ -65,7 +65,11 @@ class Staff extends \yii\db\ActiveRecord {
'address' => 'Địa chỉ',
'created_at' => 'Thời gian tạo',
'modified_at' => 'Thời gian sửa',
'card_register_time' => 'Ngày đăng ký thẻ'
'card_register_time' => 'Ngày đăng ký thẻ',
'time_in' => "Thời gian vào",
'time_out' => "Thời gian ra",
'man_hour' => "Giờ công",
'man_day' => "Ngày công"
];
}