update control logs

This commit is contained in:
2020-12-04 15:13:14 +07:00
parent 3ef04dfb5a
commit 811ed32e04
13 changed files with 282 additions and 36 deletions

View File

@@ -40,9 +40,11 @@ class CaptureLogs extends \yii\db\ActiveRecord {
return [
'id' => 'ID',
'time' => 'Time',
'image' => 'Image',
'image' => 'Live Image',
'status' => 'Status',
'remark' => 'Remark',
'staff_name' => "Name",
'staff_image' => "Registration Image"
];
}
@@ -69,4 +71,8 @@ class CaptureLogs extends \yii\db\ActiveRecord {
1 => "List management"
];
public function getListManagement() {
return $this->hasOne(ListManagement::className(), ["id" => "staff_id"]);
}
}

View File

@@ -10,24 +10,24 @@ use app\models\CaptureLogs;
/**
* CaptureLogsSearch represents the model behind the search form of `app\models\CaptureLogs`.
*/
class CaptureLogsSearch extends CaptureLogs
{
class CaptureLogsSearch extends CaptureLogs {
public $staff_name;
/**
* {@inheritdoc}
*/
public function rules()
{
public function rules() {
return [
[['id', 'time', 'status'], 'integer'],
[['image', 'remark'], 'safe'],
[['id', 'time', 'status'], 'integer'],
[['image', 'remark', 'staff_name'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
public function scenarios() {
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
@@ -39,9 +39,9 @@ class CaptureLogsSearch extends CaptureLogs
*
* @return ActiveDataProvider
*/
public function search($params)
{
public function search($params) {
$query = CaptureLogs::find();
$query->joinWith("listManagement");
// add conditions that should always apply here
@@ -65,8 +65,9 @@ class CaptureLogsSearch extends CaptureLogs
]);
$query->andFilterWhere(['like', 'image', $this->image])
->andFilterWhere(['like', 'remark', $this->remark]);
->andFilterWhere(['like', 'remark', $this->remark]);
return $dataProvider;
}
}