dream 6 months ago
parent
commit
96b5392c58

+ 12 - 12
Modules/Home/Model/SalesroomModel.class.php

@@ -379,11 +379,11 @@ class SalesroomModel{
 					$order_goods_saleshexiao_list[$k]['effect_begin_time'] = date('Y-m-d',$v['effect_begin_time']);
 					$order_goods_saleshexiao_list[$k]['effect_end_time'] = date('Y-m-d',$v['effect_end_time']);
 					//已核销次数
-					$order_goods_saleshexiao_list[$k]['has_hexiao_count'] = $v['hexiao_count']-$v['remain_hexiao_count'];
+					$order_goods_saleshexiao_list[$k]['has_hexiao_count'] = $v['hexiao_count']-$v['hexiao_count'];
 					if($v['hexiao_type'] == 1){
 						if($v['hexiao_count'] == 0){
 							$order_goods_saleshexiao_list[$k]['hexiao_count'] = '无限';
-							$order_goods_saleshexiao_list[$k]['remain_hexiao_count'] = '无限';
+							$order_goods_saleshexiao_list[$k]['hexiao_count'] = '无限';
 							$has_hexiao_count = M('lionfish_comshop_order_goods_saleshexiao_record')->where(array('order_id'=>$v['order_id'],'order_goods_id'=>$v['order_goods_id']))->sum('hexiao_count');
 							if(empty($has_hexiao_count)){
 								$has_hexiao_count = 0;
@@ -532,7 +532,7 @@ class SalesroomModel{
 		//订单核销信息表id
 		$hx_id = $order_goods_saleshexiao['id'];
 		//剩余核销数量
-		$remain_hexiao_count = $order_goods_saleshexiao['remain_hexiao_count'];
+		$remain_hexiao_count = $order_goods_saleshexiao['hexiao_count'];
 		if($order_goods_saleshexiao['hexiao_count'] > 0) {
 			$hexiao_count = 0;
 			if ($hx_time > 0) {
@@ -547,10 +547,10 @@ class SalesroomModel{
 
 			$hexiao_data = array();
 			if ($hexiao_count == $remain_hexiao_count) {
-				$hexiao_data['remain_hexiao_count'] = 0;
+				$hexiao_data['hexiao_count'] = 0;
 				$hexiao_data['is_hexiao_over'] = 1;
 			} else {
-				$hexiao_data['remain_hexiao_count'] = $remain_hexiao_count - $hexiao_count;
+				$hexiao_data['hexiao_count'] = $remain_hexiao_count - $hexiao_count;
 			}
 			$hx_result = M('lionfish_comshop_order_goods_saleshexiao')->where(array('id' => $hx_id))->save($hexiao_data);
 		}else{
@@ -640,12 +640,12 @@ class SalesroomModel{
 			$saleshexiao_info['effect_begin_time'] = date('Y-m-d H:i',$saleshexiao_info['effect_begin_time']);
 			$saleshexiao_info['effect_end_time'] = date('Y-m-d H:i',$saleshexiao_info['effect_end_time']);
 			//已核销次数
-			$saleshexiao_info['has_hexiao_count'] = $saleshexiao_info['hexiao_count']-$saleshexiao_info['remain_hexiao_count'];
+			$saleshexiao_info['has_hexiao_count'] = $saleshexiao_info['hexiao_count']-$saleshexiao_info['hexiao_count'];
 
 			if($saleshexiao_info['hexiao_type'] == 1){
 				if($saleshexiao_info['hexiao_count'] == 0){
 					$saleshexiao_info['hexiao_count'] = '无限';
-					$saleshexiao_info['remain_hexiao_count'] = '无限';
+					$saleshexiao_info['hexiao_count'] = '无限';
 				}
 			}
 			$result['saleshexiao_info'] = $saleshexiao_info;
@@ -669,7 +669,7 @@ class SalesroomModel{
 				$is_finished = false;
 			}
 			if($v['hexiao_type'] == 1 && $v['is_hexiao_over'] == 0){//按次核销
-				if($v['hexiao_count'] > 0 && $v['remain_hexiao_count'] > 0){
+				if($v['hexiao_count'] > 0 && $v['hexiao_count'] > 0){
 					$is_finished = false;
 				}
 				if($v['hexiao_count'] == 0){
@@ -714,7 +714,7 @@ class SalesroomModel{
 	public function get_hexiao_order_goods_can_refund_quantity($order_id,$order_goods_id){
 		$sales_hexiao_info = M('lionfish_comshop_order_goods_saleshexiao')->where(array('order_id'=>$order_id,'order_goods_id'=>$order_goods_id))->find();
 		if($sales_hexiao_info['hexiao_type'] == 1){
-			$can_refund_quantity = floor($sales_hexiao_info['remain_hexiao_count']/$sales_hexiao_info['one_hexiao_count']);
+			$can_refund_quantity = floor($sales_hexiao_info['hexiao_count']/$sales_hexiao_info['one_hexiao_count']);
 		}else{
 			$can_refund_quantity = $sales_hexiao_info['goods_quantity']-$sales_hexiao_info['refund_quantity'];
 		}
@@ -797,12 +797,12 @@ class SalesroomModel{
 	   $data['refund_quantity'] = $sales_hexiao_info['refund_quantity']+$refund_quantity;
 	   if($sales_hexiao_info['hexiao_type'] == 0){
 	       if($sales_hexiao_info['goods_quantity'] == $data['refund_quantity']){
-	           $data['remain_hexiao_count'] = 0;
+	           $data['hexiao_count'] = 0;
 			   $data['is_hexiao_over'] = 1;
 	       }
 	   }else{
 	       //剩余核销数量
-	       $data['remain_hexiao_count'] = $sales_hexiao_info['remain_hexiao_count']-$refund_quantity*$sales_hexiao_info['one_hexiao_count'];
+	       $data['hexiao_count'] = $sales_hexiao_info['hexiao_count']-$refund_quantity*$sales_hexiao_info['one_hexiao_count'];
 		   if($sales_hexiao_info['goods_quantity'] == $data['refund_quantity']){
 			   $data['is_hexiao_over'] = 1;
 		   }
@@ -853,7 +853,7 @@ class SalesroomModel{
 				$hexiao_record['order_id'] = $v['order_id'];
 				$hexiao_record['order_goods_id'] = $v['order_goods_id'];
 				$hexiao_record['goods_id'] = $v['goods_id'];
-				$hexiao_record['hexiao_count'] = $v['remain_hexiao_count'];
+				$hexiao_record['hexiao_count'] = $v['hexiao_count'];
 				$hexiao_record['smember_name'] = "商品过期自动使用";
 				$hexiao_record['is_admin'] = 1;
 				$hexiao_record['addtime'] = time();

+ 1 - 1
Modules/Seller/Controller/OrderController.class.php

@@ -1831,7 +1831,7 @@ class OrderController extends CommonController{
 			        if($value['hx_info']['is_hexiao_over'] == 1 || $value['hx_info']['is_hexiao_over'] == 2){
 						$value['hx_info']['is_can_refund'] = 0;
 					}else if($value['hx_info']['is_hexiao_over'] == 0){
-						//$can_refund_quantity = floor($value['hx_info']['remain_hexiao_count']/$value['hx_info']['one_hexiao_count']);
+						//$can_refund_quantity = floor($value['hx_info']['hexiao_count']/$value['hx_info']['one_hexiao_count']);
 						$can_refund_quantity = floor($value['hx_info']['hexiao_count']/$value['hx_info']['one_hexiao_count']);
 						// var_dump($can_refund_quantity);
 						if($can_refund_quantity >= 1){

+ 1 - 1
Themes/Seller/Order/detail.html

@@ -929,7 +929,7 @@
 											<?php if($item['order_status_id'] == 4){ ?>
 												<a class="btn btn-primary btn-xs hxAction"  href="javascript:;" data-href="{:U('order/hexiao_times', array('id' => $item['order_id'],'order_goods_id'=>$goods['order_goods_id']))}">确认使用</a>
 											<?php } ?>
-											<?php if($goods['hx_info']['remain_hexiao_count'] > 0 && $goods['hx_info']['remain_hexiao_count'] < $goods['hx_info']['hexiao_count'] && $goods['hx_info']['hexiao_count'] > 0 ){ ?>
+											<?php if($goods['hx_info']['hexiao_count'] > 0 && $goods['hx_info']['hexiao_count'] < $goods['hx_info']['hexiao_count'] && $goods['hx_info']['hexiao_count'] > 0 ){ ?>
 												<br/>
 												<a class="hxBtn"  href="javascript:;" data-href="{:U('order/view_hexiao_history', array('id' => $item['order_id'],'order_goods_id'=>$goods['order_goods_id']))}">(部分核销)</a>
 											<?php } ?>