|
@@ -1364,6 +1364,10 @@ class Consult extends Base
|
|
|
}
|
|
|
|
|
|
//议价审核
|
|
|
+ /**
|
|
|
+ * status:
|
|
|
+ * 0待审核 1业务主管审核通过 2 业务税率未通过 3 业务驳回 4 专员通过 5 专员驳回 6 财务通过 7 财务税率未通过 8财务驳回 9 boss通过 10 boss 税率越线通过 11 驳回
|
|
|
+ */
|
|
|
public function bargain_status(){
|
|
|
$bargainNo = isset($this->post['bargainNo'])&& $this->post['bargainNo']!=""?trim($this->post['bargainNo']):"";
|
|
|
if($bargainNo===""){
|
|
@@ -1385,10 +1389,77 @@ class Consult extends Base
|
|
|
if($status==''){
|
|
|
return error_show(1005,"参数status不能为空");
|
|
|
}
|
|
|
+ $catinfo = Db::name("cat")->where(["id"=>$bids['cat_id']])->find();
|
|
|
+ $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']/100:0;
|
|
|
+ $rate = isset($catinfo['rate']) ? $catinfo['rate']/100:0; //业务主管利率
|
|
|
+ $money_rate = isset($catinfo['money_rate']) ? $catinfo['money_rate']/100:0;//财务主管利率
|
|
|
+ $lower_rate = isset($catinfo['lower_rate']) ? $catinfo['lower_rate']/100:0;//boss主管利率
|
|
|
+ if($bids['is_gold_price']==1){
|
|
|
+ $gold = Db::name("gold_price1")->where(["type"=>$bids['metal_id'],"is_del"=>0,"status"=>1])->order("addtime desc")
|
|
|
+ ->find();
|
|
|
+// $saleprice = $open_fee/$zxinfo['num'] + $weight* $gold["price"] + $cost_fee/(1-$budget)* $weight+$pakge_fee+$mark_fee+$cert_fee+$nake_fee;
|
|
|
+ //$saleprice(最终售价) = (开模费/购买数量 + 商品重量* 最新金价 + 工艺费* 商品重量+包装费+加标费+证书费+产品裸价)/(1-成本售价/100);
|
|
|
+ $saleprice = ($bids['open_fee'] / $coninfo['num'] + $bids['weight']* $gold["price"] + $bids['cost_fee']*$bids['weight'] + $bids['pakge_fee'] +$bids['mark_fee'] + $bids['cert_fee'] + $bids['nake_fee']) / (1 - $budget);
|
|
|
+ $rate_price = ($bids['open_fee'] / $coninfo['num'] + $bids['weight']* $gold["price"] +$bids['cost_fee']*$bids['weight'] +$bids['pakge_fee'] +$bids['mark_fee'] + $bids['cert_fee'] + $bids['nake_fee']) / (1 - $rate);
|
|
|
+ $money_price = ($bids['open_fee'] / $coninfo['num'] + $bids['weight']* $gold["price"] +$bids['cost_fee']*$bids['weight'] +$bids['pakge_fee'] +$bids['mark_fee'] + $bids['cert_fee'] + $bids['nake_fee']) / (1 - $money_rate);
|
|
|
+ $lower_price = ($bids['open_fee'] / $coninfo['num'] + $bids['weight']* $gold["price"] +$bids['cost_fee']*$bids['weight'] + $bids['pakge_fee'] +$bids['mark_fee'] + $bids['cert_fee'] + $bids['nake_fee']) / (1 - $lower_rate);
|
|
|
+ }else{
|
|
|
+
|
|
|
+ if($bids['nake_fee']!=0){
|
|
|
+ $saleprice = $bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] + $bids['nake_fee']/ (1 - $budget);
|
|
|
+ $rate_price = $bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] + $bids['nake_fee']/ (1 - $rate);
|
|
|
+ $money_price =$bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] + $bids['nake_fee']/ (1 - $money_rate);
|
|
|
+ $lower_price = $bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] + $bids['nake_fee'] / (1 - $lower_rate);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ $saleprice = $bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] / (1 - $budget);
|
|
|
+ $rate_price =$bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee']/ (1 - $rate);
|
|
|
+ $money_price = $bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] / (1 - $money_rate);
|
|
|
+ $lower_price = $bids['open_fee'] / $coninfo['num']+$bids['cost_fee']*$bids['weight']+$bids['pakge_fee'] +$bids['mark_fee']+ $bids['cert_fee'] / (1 - $lower_rate);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if($status==1){
|
|
|
+ if($info['status']==0){
|
|
|
+ if($info['after_price']<$rate_price){
|
|
|
+ $info['status']=2;
|
|
|
+ }else{
|
|
|
+ $info['status']=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($info['status']==2){
|
|
|
+ $info['status']=4;
|
|
|
+ }
|
|
|
+ if($info['status']==4||$info['status']==5){
|
|
|
+ if($info['after_price']<$money_price){
|
|
|
+ $info['status']=7;
|
|
|
+ }else{
|
|
|
+ $info['status']=6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($info['status']==7){
|
|
|
+ if($info['after_price']<$lower_price){
|
|
|
+ $info['status']=10;
|
|
|
+ }else{
|
|
|
+ $info['status']=9;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if($info['status']==0){
|
|
|
+ $info['status']=3;
|
|
|
+ }
|
|
|
+ if($info['status']==2){
|
|
|
+ $info['status']=5;
|
|
|
+ }
|
|
|
+ if($info['status']==4||$info['status']==5){
|
|
|
+ $info['status']=8;
|
|
|
+ }
|
|
|
+ if($info['status']==7){
|
|
|
+ $info['status']=11;
|
|
|
+ }
|
|
|
+ }
|
|
|
$remark = isset($this->post['remark'])&& $this->post['remark']!=""?trim($this->post['remark']):"";
|
|
|
-// if($remark==""){
|
|
|
-// return error_show(1004,"参数remark不能为空");
|
|
|
-// }
|
|
|
$token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
|
|
|
if($token==''){
|
|
|
return error_show(105,"参数token不能为空");
|
|
@@ -1409,17 +1480,15 @@ class Consult extends Base
|
|
|
$info['updatetime'] =date("Y-m-d H:i:s");
|
|
|
$up =Db::name("bargain_order")->save($info);
|
|
|
if($up){
|
|
|
- if($status==5||$status==6||$status==7||$status==8||$status==9){
|
|
|
+ if($info['status']==1||$info['status']==3||$info['status']==8||$info['status']==6||$info['status']==9||$info['status']==10||$info['status']==11){
|
|
|
$bids['status']=5;
|
|
|
- if($status==8){
|
|
|
+ if($info['status']==1||$info['status']==6||$info['status']==9||$info['status']==10){
|
|
|
$bids['sale_price']=$info['after_price'];
|
|
|
if($bids['is_gold_price']==1){
|
|
|
- $catinfo = Db::name("cat")->where(["id"=>$bids['cat_id']])->find();
|
|
|
- $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']/100:0;
|
|
|
- $gold = Db::name("gold_price1")->where(["type"=>$bids['metal_id'],"is_del"=>0,"status"=>1])->order("addtime desc")
|
|
|
- ->find();
|
|
|
- $bids['sale_price']= ($bids['open_fee'] / $coninfo['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);
|
|
|
+// $gold = Db::name("gold_price1")->where(["type"=>$bids['metal_id'],"is_del"=>0,"status"=>1])->order("addtime desc")
|
|
|
+// ->find();
|
|
|
+// $bids['sale_price']= ($bids['open_fee'] / $coninfo['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'];
|
|
|
}
|
|
|
}
|