Commit e298e283 authored by hujun's avatar hujun

修改财务审核

parent 39b1a1ab
......@@ -29,35 +29,53 @@ class Finance extends Basic
*/
public function reportList() {
if ($this->request->isAjax()) {
if (!$this->request->isAjax()) {
$result = '';
switch ($this->params['check_status']) {
case 0 :
//未结单
$result = view('finance/account_statement');break;
case 4 :
//已结单
$result = view('finance/statement');break;
case 5 :
//待撤销
$result = view('finance/wait_backout');break;
case 6 :
//已撤销
$result = view('finance/statement_backout');break;
}
return $result;
}
$data['code'] = 200;
$data['msg'] = "";
$data['data'] = [];
if ($this->request->isGet()) {
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$fields = 'a.id,a.create_time,b.user_phone,b.user_name,d.internal_title,d.internal_address,a.commission,a.practical_fee,a.order_no,content';
$where['a.father_id'] = 0;
$where['c.is_del'] = 0;
$where['e.audit_level'] = 0;
$where['a.status'] = 10;
$check_status = [0,1,2,3,4];
if (in_array($this->params['check_status'], $check_status)) {
$order = 'e.id desc';
switch ($this->params['check_status']) {
case 1 :
//成交报告列表-专员审核
$where['e.audit_level'] = ['NOT IN', '0,2,3'];
//成交报告列表-经理审核
$where['e.audit_level'] = 0;
break;
case 2 :
//成交报告列表-经理审核
$where['e.audit_level'] = ['NOT IN', '0,1,3'];
//成交报告列表-总监审核
$where['e.audit_level'] = 1;
break;
case 3 :
//成交报告列表-总监审核
$where['e.audit_level'] = ['NOT IN', '0,1,2'];
//成交报告列表-出纳审核
$where['e.audit_level'] = 2;
break;
case 4 :
//成交报告列表-已结单
......@@ -94,10 +112,9 @@ class Finance extends Basic
$where['a.status'] = 21;
break;
default :
$where['e.audit_level'] = ['NULL'];
}
} else {
$where['e.audit_level'] = ['NULL'];
//成交报告列表-专员审核
$where['e.audit_level'] = NULL;
$order = 'a.id DESC';
}
if (!empty($this->params['status'])) {
......@@ -105,29 +122,10 @@ class Finance extends Basic
}
$bargain = new OBargainModel();
$data['data']['list'] = $bargain->getBargain($pageNo, $pageSize, 'a.id DESC', $fields, $where);
$data['data']['list'] = $bargain->getBargain($pageNo, $pageSize, $order, $fields, $where);
$data['data']['total'] = $bargain->getBargainTotal($where);
}
$result = $this->response($data['code'], $data['msg'], $data['data']);
} else {
$result = '';
switch ($this->params['check_status']) {
case 0 :
//未结单
$result = view('finance/account_statement');break;
case 4 :
//已结单
$result = view('finance/statement');break;
case 5 :
//待撤销
$result = view('finance/wait_backout');break;
case 6 :
//已撤销
$result = view('finance/statement_backout');break;
}
}
return $result;
return $this->response($data['code'], $data['msg'], $data['data']);
}
/**
......@@ -144,7 +142,7 @@ class Finance extends Basic
$data['data'] = [];
$bargain = new OBargainModel();
//dump($this->params);die;
if (empty($this->params['id']) || empty($this->params['source']) || empty($this->params['status'])) {
$data['code'] = 101;
$data['msg'] = 'Id is null';
......
......@@ -278,7 +278,7 @@ class OBargainModel extends Model
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function addCheckBargain(int $id,array $data, int $source, int $status) : array {
public function addCheckBargain(int $id,array $data, int $source, int $status) : bool {
$this->startTrans();
$bargain_data = $this->field('id,report_id,agent_id,order_no,order_id')->where([
'id' => $id,
......
This diff is collapsed.
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