update
This commit is contained in:
parent
03c6e5f51e
commit
a2eea43852
@ -59,7 +59,13 @@ class MaterialPurchaseRequestDetailLists extends BaseAdminDataLists implements L
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return MaterialPurchaseRequestDetail::where($this->searchWhere)
|
$params = $this->request->get(['project_id']);
|
||||||
|
$where = [];
|
||||||
|
if(isset($params['project_id']) && $params['project_id'] != ''){
|
||||||
|
$material_purchase_request_ids = MaterialPurchaseRequest::where('project_id',$params['project_id'])->column('id');
|
||||||
|
$where[] = ['material_purchase_request_id','in',$material_purchase_request_ids];
|
||||||
|
}
|
||||||
|
return MaterialPurchaseRequestDetail::where($this->searchWhere)->where($where)
|
||||||
->field(['id', 'project_material_budget_detail_id', 'num'])
|
->field(['id', 'project_material_budget_detail_id', 'num'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
@ -101,7 +107,13 @@ class MaterialPurchaseRequestDetailLists extends BaseAdminDataLists implements L
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
return MaterialPurchaseRequestDetail::where($this->searchWhere)->count();
|
$params = $this->request->get(['project_id']);
|
||||||
|
$where = [];
|
||||||
|
if(isset($params['project_id']) && $params['project_id'] != ''){
|
||||||
|
$material_purchase_request_ids = MaterialPurchaseRequest::where('project_id',$params['project_id'])->column('id');
|
||||||
|
$where[] = ['material_purchase_request_id','in',$material_purchase_request_ids];
|
||||||
|
}
|
||||||
|
return MaterialPurchaseRequestDetail::where($this->searchWhere)->where($where)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user