作者 jinglong
1 个管道 的构建 通过 耗费 8 秒

完善优惠券管理

@@ -118,21 +118,21 @@ class Bcoupon extends Backend @@ -118,21 +118,21 @@ class Bcoupon extends Backend
118 //无门槛 118 //无门槛
119 if($params['coupon_type'] == 0){ 119 if($params['coupon_type'] == 0){
120 //减少券,去掉满减金额,折扣字段, 120 //减少券,去掉满减金额,折扣字段,
121 - unset($params['full_reduce']);  
122 - unset($params['discount']); 121 + $params['full_reduce'] = 0;
  122 + $params['discount'] = 0;
123 }else{ 123 }else{
124 //折扣券,去掉满减金额,减少金额字段, 124 //折扣券,去掉满减金额,减少金额字段,
125 - unset($params['full_reduce']);  
126 - unset($params['reduce']); 125 + $params['full_reduce'] = 0;
  126 + $params['reduce'] = 0;
127 } 127 }
128 }else{ 128 }else{
129 //有门槛 129 //有门槛
130 if($params['coupon_type'] == 0){ 130 if($params['coupon_type'] == 0){
131 //减少券,去掉折扣字段, 131 //减少券,去掉折扣字段,
132 - unset($params['discount']); 132 + $params['discount'] = 0;
133 }else{ 133 }else{
134 //折扣券,去掉减少金额字段, 134 //折扣券,去掉减少金额字段,
135 - unset($params['reduce']); 135 + $params['reduce'] = 0;
136 } 136 }
137 } 137 }
138 $result = $this->model->allowField(true)->save($params); 138 $result = $this->model->allowField(true)->save($params);
@@ -192,21 +192,21 @@ class Bcoupon extends Backend @@ -192,21 +192,21 @@ class Bcoupon extends Backend
192 //无门槛 192 //无门槛
193 if($params['coupon_type'] == 0){ 193 if($params['coupon_type'] == 0){
194 //减少券,去掉满减金额,折扣字段, 194 //减少券,去掉满减金额,折扣字段,
195 - unset($params['full_reduce']);  
196 - unset($params['discount']); 195 + $params['full_reduce'] = 0;
  196 + $params['discount'] = 0;
197 }else{ 197 }else{
198 //折扣券,去掉满减金额,减少金额字段, 198 //折扣券,去掉满减金额,减少金额字段,
199 - unset($params['full_reduce']);  
200 - unset($params['reduce']); 199 + $params['full_reduce'] = 0;
  200 + $params['reduce'] = 0;
201 } 201 }
202 }else{ 202 }else{
203 //有门槛 203 //有门槛
204 if($params['coupon_type'] == 0){ 204 if($params['coupon_type'] == 0){
205 //减少券,去掉折扣字段, 205 //减少券,去掉折扣字段,
206 - unset($params['discount']); 206 + $params['discount'] = 0;
207 }else{ 207 }else{
208 //折扣券,去掉减少金额字段, 208 //折扣券,去掉减少金额字段,
209 - unset($params['reduce']); 209 + $params['reduce'] = 0;
210 } 210 }
211 } 211 }
212 $result = $row->allowField(true)->save($params); 212 $result = $row->allowField(true)->save($params);
@@ -111,21 +111,21 @@ class Coupon extends Backend @@ -111,21 +111,21 @@ class Coupon extends Backend
111 //无门槛 111 //无门槛
112 if($params['coupon_type'] == 0){ 112 if($params['coupon_type'] == 0){
113 //减少券,去掉满减金额,折扣字段, 113 //减少券,去掉满减金额,折扣字段,
114 - unset($params['full_reduce']);  
115 - unset($params['discount']); 114 + $params['full_reduce'] = 0;
  115 + $params['discount'] = 0;
116 }else{ 116 }else{
117 //折扣券,去掉满减金额,减少金额字段, 117 //折扣券,去掉满减金额,减少金额字段,
118 - unset($params['full_reduce']);  
119 - unset($params['reduce']); 118 + $params['full_reduce'] = 0;
  119 + $params['reduce'] = 0;
120 } 120 }
121 }else{ 121 }else{
122 //有门槛 122 //有门槛
123 if($params['coupon_type'] == 0){ 123 if($params['coupon_type'] == 0){
124 //减少券,去掉折扣字段, 124 //减少券,去掉折扣字段,
125 - unset($params['discount']); 125 + $params['discount'] = 0;
126 }else{ 126 }else{
127 //折扣券,去掉减少金额字段, 127 //折扣券,去掉减少金额字段,
128 - unset($params['reduce']); 128 + $params['reduce'] = 0;
129 } 129 }
130 } 130 }
131 $result = $this->model->allowField(true)->save($params); 131 $result = $this->model->allowField(true)->save($params);
@@ -185,21 +185,21 @@ class Coupon extends Backend @@ -185,21 +185,21 @@ class Coupon extends Backend
185 //无门槛 185 //无门槛
186 if($params['coupon_type'] == 0){ 186 if($params['coupon_type'] == 0){
187 //减少券,去掉满减金额,折扣字段, 187 //减少券,去掉满减金额,折扣字段,
188 - unset($params['full_reduce']);  
189 - unset($params['discount']); 188 + $params['full_reduce'] = 0;
  189 + $params['discount'] = 0;
190 }else{ 190 }else{
191 //折扣券,去掉满减金额,减少金额字段, 191 //折扣券,去掉满减金额,减少金额字段,
192 - unset($params['full_reduce']);  
193 - unset($params['reduce']); 192 + $params['full_reduce'] = 0;
  193 + $params['reduce'] = 0;
194 } 194 }
195 }else{ 195 }else{
196 //有门槛 196 //有门槛
197 if($params['coupon_type'] == 0){ 197 if($params['coupon_type'] == 0){
198 //减少券,去掉折扣字段, 198 //减少券,去掉折扣字段,
199 - unset($params['discount']); 199 + $params['discount'] = 0;
200 }else{ 200 }else{
201 //折扣券,去掉减少金额字段, 201 //折扣券,去掉减少金额字段,
202 - unset($params['reduce']); 202 + $params['reduce'] = 0;
203 } 203 }
204 } 204 }
205 $result = $row->allowField(true)->save($params); 205 $result = $row->allowField(true)->save($params);
@@ -118,21 +118,21 @@ class Gcoupon extends Backend @@ -118,21 +118,21 @@ class Gcoupon extends Backend
118 //无门槛 118 //无门槛
119 if($params['coupon_type'] == 0){ 119 if($params['coupon_type'] == 0){
120 //减少券,去掉满减金额,折扣字段, 120 //减少券,去掉满减金额,折扣字段,
121 - unset($params['full_reduce']);  
122 - unset($params['discount']); 121 + $params['full_reduce'] = 0;
  122 + $params['discount'] = 0;
123 }else{ 123 }else{
124 //折扣券,去掉满减金额,减少金额字段, 124 //折扣券,去掉满减金额,减少金额字段,
125 - unset($params['full_reduce']);  
126 - unset($params['reduce']); 125 + $params['full_reduce'] = 0;
  126 + $params['reduce'] = 0;
127 } 127 }
128 }else{ 128 }else{
129 //有门槛 129 //有门槛
130 if($params['coupon_type'] == 0){ 130 if($params['coupon_type'] == 0){
131 //减少券,去掉折扣字段, 131 //减少券,去掉折扣字段,
132 - unset($params['discount']); 132 + $params['discount'] = 0;
133 }else{ 133 }else{
134 //折扣券,去掉减少金额字段, 134 //折扣券,去掉减少金额字段,
135 - unset($params['reduce']); 135 + $params['reduce'] = 0;
136 } 136 }
137 } 137 }
138 $result = $this->model->allowField(true)->save($params); 138 $result = $this->model->allowField(true)->save($params);
@@ -192,21 +192,21 @@ class Gcoupon extends Backend @@ -192,21 +192,21 @@ class Gcoupon extends Backend
192 //无门槛 192 //无门槛
193 if($params['coupon_type'] == 0){ 193 if($params['coupon_type'] == 0){
194 //减少券,去掉满减金额,折扣字段, 194 //减少券,去掉满减金额,折扣字段,
195 - unset($params['full_reduce']);  
196 - unset($params['discount']); 195 + $params['full_reduce'] = 0;
  196 + $params['discount'] = 0;
197 }else{ 197 }else{
198 //折扣券,去掉满减金额,减少金额字段, 198 //折扣券,去掉满减金额,减少金额字段,
199 - unset($params['full_reduce']);  
200 - unset($params['reduce']); 199 + $params['full_reduce'] = 0;
  200 + $params['reduce'] = 0;
201 } 201 }
202 }else{ 202 }else{
203 //有门槛 203 //有门槛
204 if($params['coupon_type'] == 0){ 204 if($params['coupon_type'] == 0){
205 //减少券,去掉折扣字段, 205 //减少券,去掉折扣字段,
206 - unset($params['discount']); 206 + $params['discount'] = 0;
207 }else{ 207 }else{
208 //折扣券,去掉减少金额字段, 208 //折扣券,去掉减少金额字段,
209 - unset($params['reduce']); 209 + $params['reduce'] = 0;
210 } 210 }
211 } 211 }
212 $result = $row->allowField(true)->save($params); 212 $result = $row->allowField(true)->save($params);