update
This commit is contained in:
parent
427ac7a98f
commit
4686688753
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\adminapi\controller\cost_project;
|
||||||
|
|
||||||
|
use app\adminapi\controller\BaseAdminController;
|
||||||
|
use app\common\model\cost_project\CostProject;
|
||||||
|
use app\common\model\marketing\MarketingContract;
|
||||||
|
|
||||||
|
class CostStatisticsController extends BaseAdminController
|
||||||
|
{
|
||||||
|
//项目统计
|
||||||
|
public function project(){
|
||||||
|
//待立项项目
|
||||||
|
$pending_project_num = MarketingContract::field('id')->where([
|
||||||
|
['review_status','=', 1],
|
||||||
|
['contract_type','=',0],
|
||||||
|
['business_nature','=',4]
|
||||||
|
])->count();
|
||||||
|
//已立项项目
|
||||||
|
$approved_project_num = CostProject::field('id')->count();
|
||||||
|
$result['data'] = [
|
||||||
|
[
|
||||||
|
'name' => '待立项项目',
|
||||||
|
'value' => $pending_project_num
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => '已立项项目',
|
||||||
|
'value' => $approved_project_num
|
||||||
|
]
|
||||||
|
];
|
||||||
|
return $this->success('success',$result);
|
||||||
|
}
|
||||||
|
}
|
@ -63,7 +63,11 @@
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
$status = $this->request->get('status', 0);
|
$status = $this->request->get('status', 0);
|
||||||
return MarketingContract::where($this->searchWhere)->where('review_status', 1)->where('contract_type',0)
|
return MarketingContract::where($this->searchWhere)->where([
|
||||||
|
['review_status','=', 1],
|
||||||
|
['contract_type','=',0],
|
||||||
|
['business_nature','=',4]
|
||||||
|
])
|
||||||
->where('status', $status)
|
->where('status', $status)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
@ -125,11 +129,11 @@
|
|||||||
public function count(): int
|
public function count(): int
|
||||||
{
|
{
|
||||||
$status = $this->request->get('status', 0);
|
$status = $this->request->get('status', 0);
|
||||||
$where=[
|
return MarketingContract::where($this->searchWhere)->where('status', $status)->where([
|
||||||
['status', '=', $status],
|
['review_status','=', 1],
|
||||||
['contract_type', '=', 0]
|
['contract_type','=',0],
|
||||||
];
|
['business_nature','=',4]
|
||||||
return MarketingContract::where($this->searchWhere)->where($where)->where('review_status', 1)->count();
|
])->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setFileName(): string
|
public function setFileName(): string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user