|
|
@@ -15,10 +15,12 @@ class OwnerMaterialFilters
|
|
|
protected $queryBuilder;
|
|
|
protected $materialQuery;
|
|
|
protected $userQuery;
|
|
|
- protected $filters = [];
|
|
|
+ protected $filters = [
|
|
|
+ 'owner_id','material_code','created_at_start','created_at_end','special','specification'
|
|
|
+ ];
|
|
|
protected $array_filter;
|
|
|
protected $params = [
|
|
|
- 'owner_id','material_code','user_name','created_at_start','created_at_end','special'
|
|
|
+ 'owner_id','material_code','created_at_start','created_at_end','special','specification'
|
|
|
];
|
|
|
|
|
|
public function __construct(Request $request)
|
|
|
@@ -64,13 +66,6 @@ class OwnerMaterialFilters
|
|
|
return $this->materialQuery;
|
|
|
}
|
|
|
|
|
|
- private function getUserQuery():Builder
|
|
|
- {
|
|
|
- if(!$this->userQuery)
|
|
|
- $this->userQuery = User::query()->selectRaw('id');
|
|
|
- return $this->userQuery;
|
|
|
- }
|
|
|
-
|
|
|
public function owner_Id($owner_id)
|
|
|
{
|
|
|
$this->searchWay($this->queryBuilder,$owner_id,'owner_id');
|
|
|
@@ -78,12 +73,8 @@ class OwnerMaterialFilters
|
|
|
|
|
|
public function material_code($material_code)
|
|
|
{
|
|
|
- $this->getMaterialQuery()->where('code','like',"{$material_code}%");
|
|
|
- }
|
|
|
-
|
|
|
- public function user_name($user_name)
|
|
|
- {
|
|
|
- $this->getUserQuery()->where('name','like',"{$user_name}%");
|
|
|
+// $this->getMaterialQuery()->where('code','like',"{$material_code}%");
|
|
|
+ $this->queryBuilder->where('material_code','like',"{$material_code}%");
|
|
|
}
|
|
|
|
|
|
public function created_at_start($created_at)
|
|
|
@@ -100,6 +91,10 @@ class OwnerMaterialFilters
|
|
|
{
|
|
|
$this->queryBuilder->where('special','like',"{$special}%");
|
|
|
}
|
|
|
+ public function specification($specification)
|
|
|
+ {
|
|
|
+ $this->queryBuilder->where('specification','like',"{$specification}%");
|
|
|
+ }
|
|
|
|
|
|
public function afterApply()
|
|
|
{
|