|
@@ -1190,6 +1190,20 @@ class Consult extends Base
|
|
|
if($bargain_price===""){
|
|
|
return error_show(1004,"参数bargain_price不能为空");
|
|
|
}
|
|
|
+ $cost_price = isset($this->post['cost_price'])&& $this->post['cost_price']!=""?floatval($this->post['cost_price']):"";
|
|
|
+ if($info['is_gold_price']==1){
|
|
|
+ if($cost_price==""){
|
|
|
+ return error_show(1004,"参数cost_price不能为空");
|
|
|
+ }
|
|
|
+ $catinfo = Db::name("cat")->where(["id"=>$info['cat_id']])->find();
|
|
|
+ $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']/100:0;
|
|
|
+ $gold = Db::name("gold_price1")->where(["type"=>$info['metal_id'],"is_del"=>0,"status"=>1])->order("addtime desc")
|
|
|
+ ->find();
|
|
|
+
|
|
|
+ $bargain_price = ($info['open_fee'] / $info['num'] + $info['weight'] * $gold["price"] + $cost_price *$info['weight'] +
|
|
|
+ $info['pakge'] + $info['mark_fee'] +$info['cert_fee'] +$info['nake_fee']) / (1 - $budget);
|
|
|
+ }
|
|
|
+
|
|
|
$bargain_reason = isset($this->post['bargain_reason'])&& $this->post['bargain_reason']!=""?trim($this->post['bargain_reason']):"";
|
|
|
// if($bargain_reason===""){
|
|
|
// return error_show(1004,"参数bargain_reason不能为空");
|
|
@@ -1233,9 +1247,9 @@ class Consult extends Base
|
|
|
"bargain_reason"=>$bargain_reason,
|
|
|
"sale_price"=>$info['sale_price'],
|
|
|
"cost_before_price"=>$info['cost_fee'],
|
|
|
- "cost_after_price"=>$info['cost_fee'],
|
|
|
- "before_rate"=>$info['cost_fee'],
|
|
|
- "after_rate"=>$info['cost_fee'],
|
|
|
+ "cost_after_price"=>$cost_price,
|
|
|
+ "before_rate"=>($info['sale_price']-$info['total_fee'])/$info['sale_price'],
|
|
|
+ "after_rate"=>($bargain_price-$info['total_fee'])/$bargain_price,
|
|
|
"after_price"=>$bargain_price,
|
|
|
"exam_info"=>"",
|
|
|
"status"=>1,
|
|
@@ -1393,6 +1407,15 @@ class Consult extends Base
|
|
|
$bids['status']=5;
|
|
|
if($status==4){
|
|
|
$bids['sale_price']=$info['after_price'];
|
|
|
+ if($info['is_gold_price']==1){
|
|
|
+ $catinfo = Db::name("cat")->where(["id"=>$info['cat_id']])->find();
|
|
|
+ $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']/100:0;
|
|
|
+ $gold = Db::name("gold_price1")->where(["type"=>$info['metal_id'],"is_del"=>0,"status"=>1])->order("addtime desc")
|
|
|
+ ->find();
|
|
|
+ $bids['sale_price']= ($bids['open_fee'] / $bids['num'] + $bids['weight'] * $gold["price"] + $info['cost_after_price'] *$bids['weight'] +
|
|
|
+ $bids['pakge_fee'] + $bids['mark_fee'] +$bids['cert_fee'] +$bids['nake_fee']) /(1 - $budget);
|
|
|
+ $bids['sale_cost_fee'] = $info['cost_after_price'];
|
|
|
+ }
|
|
|
}
|
|
|
$bids['updatetime']=date("Y-m-d H:i:s");
|
|
|
$up =Db::name("consult_bids")->save($bids);
|