wugg 7 kuukautta sitten
vanhempi
commit
572b12aab1
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 1 1
      app/bug/controller/Note.php
  2. 3 0
      app/bug/model/WechatPush.php

+ 1 - 1
app/bug/controller/Note.php

@@ -227,7 +227,7 @@ class Note extends Base
 	    if($param['status']!==""){
 	        $where[]=['status',"=",$param['status']];
 	    }
-	    $list = \app\bug\model\WechatPush::where($where)->order("createTime desc")->paginate(["list_rows"=>$param['size'],"page"=>$param['page']]);
+	    $list = \app\bug\model\WechatPush::with(['note'])->where($where)->order("createTime desc")->paginate(["list_rows"=>$param['size'],"page"=>$param['page']]);
 	    return success("获取成功",['list'=>$list->items(),'count'=>$list->total()]);
     }
 }

+ 3 - 0
app/bug/model/WechatPush.php

@@ -6,4 +6,7 @@ namespace app\bug\model;
 
 class WechatPush extends Base {
     protected $createTime='createTime';
+    public function Note(){
+        return $this->belongsTo('Note','bugNo','bugNo')->bind(['title']);
+    }
 }