xieruidong 2 年之前
父节点
当前提交
6d5af5bde1
共有 3 个文件被更改,包括 69 次插入0 次删除
  1. 9 0
      application/admin/controller/Goods.php
  2. 3 0
      application/common/model/Goods.php
  3. 57 0
      application/common/model/GoodsBind.php

+ 9 - 0
application/admin/controller/Goods.php

@@ -188,7 +188,16 @@ class Goods extends Backend
             $this->assign('row',$goods);
             return $this->fetch();
         }else{
+            $e=input('e');
+            $skuId=input('sku_id');
+            $goodsId=input('goods_id');
+            if($e=='get'){
+                $goods=$this->model->find($goodsId);
+                $bindId=$goods->binds()->column('bind_goods_id');
+                $this->success('',$bindId);
+            }
 
+            $this->success();
         }
     }
 }

+ 3 - 0
application/common/model/Goods.php

@@ -27,6 +27,9 @@ class Goods Extends Model
     public function service(){
         return $this->hasMany(GoodsService::class);
     }
+    public function binds(){
+        return $this->hasMany(GoodsBind::class);
+    }
     public function category(){
         return $this->belongsTo(Category::class);
     }

+ 57 - 0
application/common/model/GoodsBind.php

@@ -0,0 +1,57 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+/**
+ * 邮箱验证码
+ */
+class GoodsBind Extends Model
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}