add changes to procurement
This commit is contained in:
@@ -12,14 +12,22 @@ use common\models\Procurement;
|
||||
*/
|
||||
class ProcurementSearch extends Procurement
|
||||
{
|
||||
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
|
||||
public $timestampStart;
|
||||
public $timestampEnd;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_procurement', 'id_warehouse', 'id_user', 'id_product', 'count', 'stock', 'purchase_price'], 'integer'],
|
||||
[['description', 'created_at', 'updated_at'], 'safe'],
|
||||
[[ 'id_warehouse', 'id_user', 'id_product', ], 'integer'],
|
||||
[[ 'date_start', ], 'date' , 'timestampAttribute' => 'timestampStart' ],
|
||||
[[ 'date_end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -56,18 +64,14 @@ class ProcurementSearch extends Procurement
|
||||
}
|
||||
|
||||
$query->andFilterWhere([
|
||||
'id_procurement' => $this->id_procurement,
|
||||
'id_warehouse' => $this->id_warehouse,
|
||||
'id_user' => $this->id_user,
|
||||
'id_product' => $this->id_product,
|
||||
'count' => $this->count,
|
||||
'stock' => $this->stock,
|
||||
'purchase_price' => $this->purchase_price,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere([ '>=', 'created_at', $this->date_start ] );
|
||||
$query->andFilterWhere([ '<', 'created_at', $this->timestampEnd ] );
|
||||
|
||||
$query->andFilterWhere(['like', 'description', $this->description]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user