Parcourir la source

Merge remote-tracking branch 'origin/develop' into develop

ncs_23818 il y a 2 ans
Parent
commit
c35ec3ba0b

+ 2 - 0
application/admin/controller/OrderInfoRefund.php

@@ -117,6 +117,7 @@ class OrderInfoRefund extends Backend
         Db::commit();
         $this->success();
     }
+    #退款退货的退款
     public function tk($ids){
         Db::startTrans();
         $refund=$this->model->lock(true)->find($ids);
@@ -130,6 +131,7 @@ class OrderInfoRefund extends Backend
         Db::commit();
         $this->success();
     }
+    #换货的完成
     public function complete($ids){
         Db::startTrans();
         $refund=$this->model->lock(true)->find($ids);

+ 4 - 0
application/api/controller/mall/Orders.php

@@ -6,6 +6,7 @@ use app\common\controller\Api;
 use app\common\model\OrderInfo;
 use app\common\model\OrderVoucher;
 use app\common\model\Refund;
+use app\common\service\BaseService;
 use app\common\service\OrderService;
 use app\common\service\RefundService;
 use app\common\validate\TaxValidate;
@@ -53,6 +54,7 @@ class Orders extends Api
      * @ApiReturnParams (name=goods.0.amount_coupon,description=优惠券优惠的金额)
      * @ApiReturnParams (name=goods.0.amount_coupon_kill,description=秒杀活动优惠的金额)
      * @ApiReturnParams (name=goods.0.amount_install,description=安装费的金额)
+     * @ApiReturnParams (name=send_delay_day,description=发货时间)
      */
     public function preview(){
         $data=$this->_validate([
@@ -70,6 +72,8 @@ class Orders extends Api
         $service->setCouponId($data['coupon_id']??0);
         $info=$service->calculate();
 
+        $info['send_delay_day']=BaseService::send_delay_day();
+
         $this->success('',$info);
     }
 

+ 2 - 2
application/common/model/Refund.php

@@ -312,7 +312,7 @@ class Refund Extends Model
         if(!empty($extend['audit_remark'])) {
             $this->audit_remark = $extend['audit_remark'];
         }
-        if($this->has_money) {
+        if($this->has_money && !empty($extend['amount_last'])) {
             $this->amount_last = $extend['amount_last'];
         }
         $this->audit_time=time();
@@ -519,7 +519,7 @@ class Refund Extends Model
     }
     #是否需要完成
     public function getNeedCompleteAttr($_,$model){
-        $con1 = $this->refund_type==self::REFUND_TYPE_HHBX;
+        $con1 = $model['refund_type']==self::REFUND_TYPE_HHBX;
         $con2 = $model['refund_status']==self::REFUND_RUNNING;
         return $con1 && $con2;
     }

+ 3 - 0
application/common/service/BaseService.php

@@ -5,4 +5,7 @@ class BaseService{
     protected function error($msg){
         throw_user($msg);
     }
+    public static function send_delay_day(){
+        return config('site.send_delay_day')?:0;
+    }
 }

+ 6 - 1
public/api.html

@@ -10972,6 +10972,11 @@
                                                                 <td>string</td>
                                                                 <td>安装费的金额</td>
                                                             </tr>
+                                                                                                                        <tr>
+                                                                <td>send_delay_day</td>
+                                                                <td>string</td>
+                                                                <td>发货时间</td>
+                                                            </tr>
                                                                                                                     </tbody>
                                                     </table>
                                                                                                     </div>
@@ -19401,7 +19406,7 @@
 
                 </div>
                 <div class="col-md-6" align="right">
-                    Generated on 2022-12-13 14:27:01 <a href="./" target="_blank">苏州屏酷有限公司</a>
+                    Generated on 2022-12-13 15:27:54 <a href="./" target="_blank">苏州屏酷有限公司</a>
                 </div>
             </div>