Commit a25cd455 authored by hujun's avatar hujun

id

parent ecda759e
...@@ -63,7 +63,7 @@ class Cost extends Basic ...@@ -63,7 +63,7 @@ class Cost extends Basic
$where = $this->buildWhere($this->params); $where = $this->buildWhere($this->params);
$field = 'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,a.status,'; $field = 'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,a.status,';
$field .= 'b.name as agent_name,a.site_id'; $field .= 'b.name as agent_name,a.site_id,a.payee_agent_id';
$cost_service = new CostService(); $cost_service = new CostService();
if (empty($this->params['excel'])) { if (empty($this->params['excel'])) {
...@@ -73,9 +73,17 @@ class Cost extends Basic ...@@ -73,9 +73,17 @@ class Cost extends Basic
$order = 'a.ID DESC'; $order = 'a.ID DESC';
} }
$list = $this->fee_model->getJoinAgentList($pageNo, $pageSize, $order, $field, $where); $list = $this->fee_model->getJoinAgentList($pageNo, $pageSize, $order, $field, $where);
$s_redis = new RedisCacheService();
foreach($list as $k=>$v) { foreach($list as $k=>$v) {
$list[$k]['type_name'] = $cost_service->getFeeType($v['type']); $list[$k]['type_name'] = $cost_service->getFeeType($v['type']);
$list[$k]['fee_item_name'] = $cost_service->getFeeItem($v['fee_item']); $list[$k]['fee_item_name'] = $cost_service->getFeeItem($v['fee_item']);
if (empty($v['payee_agent_id'])) {
$list[$k]['payee_agent_name'] = '';
} else {
$agent_data= $s_redis->getRedisCache(2, $v['payee_agent_id']);
$list[$k]['payee_agent_name'] = $agent_data['name'];
}
} }
$data['list'] = $list; $data['list'] = $list;
$data['total'] = $this->fee_model->getJoinAgentListTotal($where); $data['total'] = $this->fee_model->getJoinAgentListTotal($where);
...@@ -334,11 +342,23 @@ class Cost extends Basic ...@@ -334,11 +342,23 @@ class Cost extends Basic
{ {
$code = 101; $code = 101;
$params = $this->params; $params = &$this->params;
if (empty($params['id'])) { if (empty($params['id'] && empty($params['id_array']))) {
return $this->response($code, '参数错误'); return $this->response($code, '参数错误');
} }
if (isset($params['id_array'])) {
if (empty($params['id_array'])) {
return $this->response($code, '参数错误');
}
}
if (isset($params['id'])) {
if (empty($params['id'])) {
return $this->response($code, '参数错误');
}
}
switch($params['check_status']) { switch($params['check_status']) {
case 1 : case 1 :
$params['status'] = 1;break; $params['status'] = 1;break;
......
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