Commit 5998aa08 authored by clone's avatar clone Committed by hujun

bug

parent 6a114e60
...@@ -645,8 +645,8 @@ class Finance extends Basic ...@@ -645,8 +645,8 @@ class Finance extends Basic
*/ */
public function addRealIncome() public function addRealIncome()
{ {
if (empty($this->params['bargain_id'])) { if (empty($this->params['bargain_id']) || empty($this->params['is_account_commission'])) {
return $this->response(101, '新增实收参数错误'); return $this->response(101, '请求参数错误');
} }
$m_bargain = new OBargainModel(); $m_bargain = new OBargainModel();
...@@ -665,12 +665,13 @@ class Finance extends Basic ...@@ -665,12 +665,13 @@ class Finance extends Basic
$add_arr = $update_arr = []; $add_arr = $update_arr = [];
$i = $j = 0; $i = $j = 0;
foreach ($data as $item) { foreach ($data as $item) {
if (!$item['fee'] || !$item['operation_date']) { if (!isset($item['practical_fee']) || !isset($item['cash']) || !isset($item['service_charge']) ||
continue; !isset($item['charity_fund']) || !isset($item['real_fee'])) {
return $this->response(101, '请求参数异常请检查后提交');
} }
if ($item["id"] > 0) { if ($item["id"] > 0) {
$update_arr[$i]['id'] = $item['id']; $update_arr[$i]['id'] = $item['commission_id'];
$update_arr[$i]['practical_fee'] = $item["practical_fee"]; $update_arr[$i]['practical_fee'] = $item["practical_fee"];
$update_arr[$i]['cash'] = $item["cash"]; $update_arr[$i]['cash'] = $item["cash"];
$update_arr[$i]['service_charge'] = $item['service_charge']; $update_arr[$i]['service_charge'] = $item['service_charge'];
...@@ -678,7 +679,7 @@ class Finance extends Basic ...@@ -678,7 +679,7 @@ class Finance extends Basic
$update_arr[$i]['real_fee'] = $item['real_fee']; $update_arr[$i]['real_fee'] = $item['real_fee'];
$update_arr[$i]['operation_id'] = $this->userId; $update_arr[$i]['operation_id'] = $this->userId;
//确认分佣加时间 否则 只是保存分佣数据 //确认分佣加时间 否则 只是保存分佣数据
if ($item['is_confirm_date'] == 1) { if ($this->params['is_account_commission'] == 1) {
$update_arr[$i]['confirm_date'] = date("Y-m-d H:i:s",time()); $update_arr[$i]['confirm_date'] = date("Y-m-d H:i:s",time());
$update_arr[$i]['confirm_status'] = 1; $update_arr[$i]['confirm_status'] = 1;
} }
...@@ -696,7 +697,7 @@ class Finance extends Basic ...@@ -696,7 +697,7 @@ class Finance extends Basic
$add_arr[$j]['role'] = $item['role']; $add_arr[$j]['role'] = $item['role'];
$add_arr[$j]['agent_id'] = $item['agent_id']; $add_arr[$j]['agent_id'] = $item['agent_id'];
//确认分佣加时间 否则 只是保存分佣数据 //确认分佣加时间 否则 只是保存分佣数据
if ($item['is_confirm_date'] == 1) { if ($this->params['is_account_commission'] == 1) {
$add_arr[$j]['confirm_date'] = date("Y-m-d H:i:s",time()); $add_arr[$j]['confirm_date'] = date("Y-m-d H:i:s",time());
$add_arr[$j]['confirm_status'] = 1; $add_arr[$j]['confirm_status'] = 1;
} }
......
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