xieruidong 2 yıl önce
ebeveyn
işleme
2a6af57393

+ 4 - 0
application/admin/controller/Coupon.php

@@ -107,6 +107,10 @@ class Coupon extends Backend
         $this->error('');
     }
     public function send($ids){
+        if($this->request->isGet()){
+            return $this->fetch();
+        }else{
 
+        }
     }
 }

+ 25 - 0
application/common/model/UserCoupon.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+
+class UserCoupon extends Model
+{
+    protected $autoWriteTimestamp=true;
+    protected $updateTime=null;
+
+    public function bindGoods(){
+        return $this->hasMany(UserCouponGoods::class);
+    }
+
+    protected static function init()
+    {
+        self::beforeWrite(function (self $coupon){
+            if($coupon['type']==2){
+                unset($coupon['amount_full']);
+            }
+        });
+    }
+}

+ 10 - 0
application/common/model/UserCouponGoods.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+
+class UserCouponGoods extends Model
+{
+}