Commit 1ebc0be9 authored by clone's avatar clone

bug

parent ab3d8859
...@@ -704,13 +704,18 @@ class Finance extends Basic ...@@ -704,13 +704,18 @@ class Finance extends Basic
$j++; $j++;
} }
} }
if ($i > 0) { if($j == 0){ //没有新增数据,则把最后一条数据的分佣比例和应分佣金改掉
$m_partial->addCommission($update_arr);
} }
if ($j > 0) { if ($j > 0) {
$m_partial->addCommission($add_arr); $m_partial->addCommission($add_arr);
} }
if ($i > 0) {
$m_partial->addCommission($update_arr);
}
// $data = $m_partial->addCommission($this->params, $this->userId); // $data = $m_partial->addCommission($this->params, $this->userId);
return $this->response("200", "request success", []); return $this->response("200", "request success", []);
} }
......
...@@ -618,13 +618,15 @@ class OBargainModel extends Model ...@@ -618,13 +618,15 @@ class OBargainModel extends Model
$partial_commission = $m_partial->field('id,scale,practical_fee,cash,service_charge,charity_fund,real_fee,confirm_date,confirm_status,should_commission') $partial_commission = $m_partial->field('id,scale,practical_fee,cash,service_charge,charity_fund,real_fee,confirm_date,confirm_status,should_commission')
->where('bargain_id', $v['id']) ->where('bargain_id', $v['id'])
->where('is_del', 0) ->where('is_del', 0)
->order("id desc") ->order("id asc")
->select(); ->select();
//todo 最后一个分佣提成如果不为空则取其值 //todo 最后一个分佣提成如果不为空则取其值
if ($partial_commission && $partial_commission[0]["scale"] > 0) { $i = count($partial_commission) - 1;
$result[$k]["scale"] = $partial_commission[0]["scale"]; if ($partial_commission && $partial_commission[$i]["scale"] > 0) {
$result[$k]["scale_fee"] = $partial_commission[0]["should_commission"]; $result[$k]["scale"] = $partial_commission[$i]["scale"];
$result[$k]["scale_fee"] = $partial_commission[$i]["should_commission"];
} }
$result["last_commission_id"] = $partial_commission[$i]["id"];
$result[$k]['partial_commission'] = $partial_commission; $result[$k]['partial_commission'] = $partial_commission;
} }
return $result; return $result;
......
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