Commit b6419b05 authored by zhuwei's avatar zhuwei

成本明细表

parent 561e2e76
...@@ -5,6 +5,7 @@ namespace app\index\controller; ...@@ -5,6 +5,7 @@ namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\api\service\ActivityService; use app\api\service\ActivityService;
use app\model\CActivity; use app\model\CActivity;
use app\model\FStoreCostExt;
use think\Request; use think\Request;
/** /**
...@@ -16,31 +17,24 @@ use think\Request; ...@@ -16,31 +17,24 @@ use think\Request;
*/ */
class CostDetail extends Basic class CostDetail extends Basic
{ {
private $activityService; private $storeCostExt;
public function __construct(Request $request = null) public function __construct(Request $request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->activityService = new ActivityService(); $this->storeCostExt = new FStoreCostExt();
} }
/** /**
* 获取活动列表 * 成本明细表
* doc url :http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=818
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getActivityList() public function getCostDetailList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"id" => 1,
"title" => "asd",
"pageNo" => 1,
"pageSize" => 15,
);*/ );*/
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
...@@ -55,8 +49,8 @@ class CostDetail extends Basic ...@@ -55,8 +49,8 @@ class CostDetail extends Basic
$where_["id"] = $params['id']; $where_["id"] = $params['id'];
} }
$where_["status"] = array("neq", 4); $where_["status"] = array("neq", 4);
$list = $activityModel->getActivityList($field, $where_, $pageNo, $pageSize); $list = $this->storeCostExt->getStoreCostExt($field, $where_, $pageNo, $pageSize);
$count = $activityModel->getActivityCount($field, $where_); $count = $this->storeCostExt->getStoreCostExtTotal($field, $where_);
$result["list"] = $list; $result["list"] = $list;
$result["total"] = $count; $result["total"] = $count;
return $this->response("200", "success", $result); return $this->response("200", "success", $result);
......
...@@ -27,6 +27,8 @@ class FStoreCostExt extends BaseModel ...@@ -27,6 +27,8 @@ class FStoreCostExt extends BaseModel
{ {
$result = $this->db_ $result = $this->db_
->field($field) ->field($field)
->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->where($params) ->where($params)
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
...@@ -38,6 +40,8 @@ class FStoreCostExt extends BaseModel ...@@ -38,6 +40,8 @@ class FStoreCostExt extends BaseModel
{ {
$result = $this->db_ $result = $this->db_
->field($field) ->field($field)
->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->where($params) ->where($params)
->count(); ->count();
return $result; return $result;
......
...@@ -537,6 +537,9 @@ Route::group('index', [ ...@@ -537,6 +537,9 @@ Route::group('index', [
'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审 'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审
'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审 'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审
'checkCostFive/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 4]], //费用报销审核三审 'checkCostFive/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 4]], //费用报销审核三审
'getCostDetailList' => [ 'index/CostDetail/getCostDetailList', [ 'method' => 'POST|GET' ] ],
]); ]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment