|
@@ -76,7 +76,6 @@ class Sale extends Base
|
|
$is_stock=$ct['is_stock'];
|
|
$is_stock=$ct['is_stock'];
|
|
$spuCode = $ct['spuCode'];
|
|
$spuCode = $ct['spuCode'];
|
|
$skuCode = $ct['skuCode'];
|
|
$skuCode = $ct['skuCode'];
|
|
-
|
|
|
|
$is_activity= isset($this->post['is_activity'])&&$this->post['is_activity']!=="" ?$this->post['is_activity']:"";
|
|
$is_activity= isset($this->post['is_activity'])&&$this->post['is_activity']!=="" ?$this->post['is_activity']:"";
|
|
$actcode= isset($this->post['act_code'])&&$this->post['act_code']!=="" ?trim($this->post['act_code']):"";
|
|
$actcode= isset($this->post['act_code'])&&$this->post['act_code']!=="" ?trim($this->post['act_code']):"";
|
|
if($order_type==1){
|
|
if($order_type==1){
|
|
@@ -144,7 +143,7 @@ class Sale extends Base
|
|
"demo_fee"=>$ct['demo_fee'],
|
|
"demo_fee"=>$ct['demo_fee'],
|
|
"good_num"=>$good_num,
|
|
"good_num"=>$good_num,
|
|
"good_type"=>$goodtype,
|
|
"good_type"=>$goodtype,
|
|
- "order_type"=>$order_type,
|
|
|
|
|
|
+ "order_type"=>$is_stock==1?1:2,
|
|
'send_way'=>2
|
|
'send_way'=>2
|
|
|
|
|
|
];
|
|
];
|
|
@@ -613,6 +612,13 @@ class Sale extends Base
|
|
if($good_num===""){
|
|
if($good_num===""){
|
|
return error_show(1003,"参数 good_num 不能为空");
|
|
return error_show(1003,"参数 good_num 不能为空");
|
|
}
|
|
}
|
|
|
|
+ $sale_price = isset($this->post['sale_price']) && $this->post['sale_price'] != "" ? floatval($this->post['sale_price']) : "";
|
|
|
|
+ if ($sale_price === "") {
|
|
|
|
+ return error_show(1003, "参数 sale_price 销售单价 不能为空");
|
|
|
|
+ }
|
|
|
|
+ if ($sale_price < $zxinfo['sale_price']) {
|
|
|
|
+ return error_show(1003, "修改的销售单价不能低于原来的销售单价");
|
|
|
|
+ }
|
|
$sendtype = isset($this->post['sendtype'])&&$this->post['sendtype']!="" ? intval($this->post['sendtype']):"";
|
|
$sendtype = isset($this->post['sendtype'])&&$this->post['sendtype']!="" ? intval($this->post['sendtype']):"";
|
|
if($sendtype==""){
|
|
if($sendtype==""){
|
|
return error_show(1003,"参数sendtype不能为空");
|
|
return error_show(1003,"参数sendtype不能为空");
|
|
@@ -628,7 +634,7 @@ class Sale extends Base
|
|
"skuCode"=>$skuCode,
|
|
"skuCode"=>$skuCode,
|
|
"orderCode"=>$orderCode,
|
|
"orderCode"=>$orderCode,
|
|
"good_name"=>$zxinfo['good_name'],
|
|
"good_name"=>$zxinfo['good_name'],
|
|
- "sale_price"=>$zxinfo['sale_price'],
|
|
|
|
|
|
+ "sale_price"=>$sale_price,
|
|
"total_fee"=>$zxinfo['total_fee'],
|
|
"total_fee"=>$zxinfo['total_fee'],
|
|
"pakge_fee"=>$zxinfo['pakge_fee'],
|
|
"pakge_fee"=>$zxinfo['pakge_fee'],
|
|
"cert_fee"=>$zxinfo['cert_fee'],
|
|
"cert_fee"=>$zxinfo['cert_fee'],
|
|
@@ -676,7 +682,7 @@ class Sale extends Base
|
|
"apply_id"=>$rm,
|
|
"apply_id"=>$rm,
|
|
"apply_name"=>$ri,
|
|
"apply_name"=>$ri,
|
|
"origin_price"=>$zxinfo['nake_fee'],
|
|
"origin_price"=>$zxinfo['nake_fee'],
|
|
- "sale_price"=>$zxinfo['sale_price'],
|
|
|
|
|
|
+ "sale_price" => $sale_price,//销售单价支持修改
|
|
"post_fee"=>0,
|
|
"post_fee"=>0,
|
|
"status"=>0,
|
|
"status"=>0,
|
|
"send_num"=>0,
|
|
"send_num"=>0,
|
|
@@ -697,7 +703,7 @@ class Sale extends Base
|
|
"order_type"=>3,
|
|
"order_type"=>3,
|
|
"addtime"=>date("Y-m-d H:i:s"),
|
|
"addtime"=>date("Y-m-d H:i:s"),
|
|
"updatetime"=>date("Y-m-d H:i:s"),
|
|
"updatetime"=>date("Y-m-d H:i:s"),
|
|
- 'total_price'=>round($zxinfo['sale_price']*$good_num,2),
|
|
|
|
|
|
+ 'total_price' => round($sale_price * $good_num, 2),
|
|
];
|
|
];
|
|
$datainfo = Db::name('sale')->insert($data, true);
|
|
$datainfo = Db::name('sale')->insert($data, true);
|
|
if($datainfo>0){
|
|
if($datainfo>0){
|
|
@@ -1252,7 +1258,7 @@ class Sale extends Base
|
|
"demo_fee"=>$good['demo_fee'],
|
|
"demo_fee"=>$good['demo_fee'],
|
|
"good_num"=>$data['good_num'],
|
|
"good_num"=>$data['good_num'],
|
|
"good_type"=>1,
|
|
"good_type"=>1,
|
|
- "order_type"=>2,
|
|
|
|
|
|
+ "order_type"=>$good['is_stock']==1?1:2,
|
|
'send_way'=>2
|
|
'send_way'=>2
|
|
];
|
|
];
|
|
if($good['is_stock']==0) {
|
|
if($good['is_stock']==0) {
|