Commit b6419b05 authored by zhuwei's avatar zhuwei

成本明细表

parent 561e2e76
......@@ -5,6 +5,7 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\api\service\ActivityService;
use app\model\CActivity;
use app\model\FStoreCostExt;
use think\Request;
/**
......@@ -16,31 +17,24 @@ use think\Request;
*/
class CostDetail extends Basic
{
private $activityService;
private $storeCostExt;
public function __construct(Request $request = null)
{
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
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getActivityList()
public function getCostDetailList()
{
$params = $this->params;
/* $params = array(
"id" => 1,
"title" => "asd",
"pageNo" => 1,
"pageSize" => 15,
);*/
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
......@@ -55,8 +49,8 @@ class CostDetail extends Basic
$where_["id"] = $params['id'];
}
$where_["status"] = array("neq", 4);
$list = $activityModel->getActivityList($field, $where_, $pageNo, $pageSize);
$count = $activityModel->getActivityCount($field, $where_);
$list = $this->storeCostExt->getStoreCostExt($field, $where_, $pageNo, $pageSize);
$count = $this->storeCostExt->getStoreCostExtTotal($field, $where_);
$result["list"] = $list;
$result["total"] = $count;
return $this->response("200", "success", $result);
......
......@@ -27,6 +27,8 @@ class FStoreCostExt extends BaseModel
{
$result = $this->db_
->field($field)
->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
......@@ -38,6 +40,8 @@ class FStoreCostExt extends BaseModel
{
$result = $this->db_
->field($field)
->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->where($params)
->count();
return $result;
......
......@@ -537,6 +537,9 @@ Route::group('index', [
'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审
'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审
'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