更新细节
This commit is contained in:
parent
bb7eaae405
commit
972383d028
@ -18,7 +18,7 @@ namespace app\adminapi\lists\cost;
|
|||||||
use app\adminapi\lists\BaseAdminDataLists;
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
use app\common\model\cost\CostBudgetDetail;
|
use app\common\model\cost\CostBudgetDetail;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CostBudgetDetail列表
|
* CostBudgetDetail列表
|
||||||
@ -38,7 +38,7 @@ class CostBudgetDetailLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
public function setSearch(): array
|
public function setSearch(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'=' => ['cost_subject_id', 'cost_budget_id'],
|
'=' => ['cbd.org_id', 'cbd.dept_id', 'cbd.cost_subject_id', 'cbd.cost_budget_id'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,15 +54,17 @@ class CostBudgetDetailLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return CostBudgetDetail::where($this->searchWhere)
|
return Db::name('CostBudgetDetail')->alias('cbd')
|
||||||
->field(['id', 'cost_subject_id', 'cost_budget_id', 'dept_id', 'month1', 'month2', 'month3', 'month4', 'month5', 'month6', 'month7', 'month8', 'month9', 'month10', 'month11', 'month12'])
|
->where($this->searchWhere)
|
||||||
|
->whereNull('cbd.delete_time')
|
||||||
|
->leftJoin('cost_subject cs','cs.id = cbd.cost_subject_id')
|
||||||
|
->leftJoin('cost_budget cb','cb.id = cbd.cost_budget_id')
|
||||||
|
->leftJoin('orgs o','o.id = cb.org_id')
|
||||||
|
->leftJoin('dept d','d.id = cb.dept_id')
|
||||||
|
->field('cbd.*, d.name as dept_name, o.name as org_name, cb.years, cs.sn, cs.subject1, cs.subject2')
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['cbd.id' => 'desc'])
|
||||||
->select()->each(function($item, $key){
|
->select()->each(function($item, $key){
|
||||||
//关联数据后续添加
|
|
||||||
$item['subject_no'] = '科目编号';
|
|
||||||
$item['subject_first'] = '一级科目';
|
|
||||||
$item['subject_second'] = '二级科目';
|
|
||||||
return $item;
|
return $item;
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
@ -77,7 +79,13 @@ class CostBudgetDetailLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
return CostBudgetDetail::where($this->searchWhere)->count();
|
return Db::name('CostBudgetDetail')->alias('cbd')
|
||||||
|
->where($this->searchWhere)
|
||||||
|
->whereNull('cbd.delete_time')
|
||||||
|
->leftJoin('cost_subject cs','cs.id = cbd.cost_subject_id')
|
||||||
|
->leftJoin('cost_budget cb','cb.id = cbd.cost_budget_id')
|
||||||
|
->leftJoin('orgs o','o.id = cb.org_id')
|
||||||
|
->leftJoin('dept d','d.id = cb.dept_id')->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -63,7 +63,6 @@ class CostBudgetLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['cb.id' => 'desc'])
|
->order(['cb.id' => 'desc'])
|
||||||
->select()->each(function($item, $key){
|
->select()->each(function($item, $key){
|
||||||
$item['year'] = date('Y', strtotime($item['document_preparation_time']));
|
|
||||||
//关联数据后续添加
|
//关联数据后续添加
|
||||||
$item['approve_no'] = '付款单号';
|
$item['approve_no'] = '付款单号';
|
||||||
$item['approve_step'] = '流程步骤';
|
$item['approve_step'] = '流程步骤';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user