Esempio n. 1
1
 /**
  * 关联查询
  * @param $relation
  * @param \Closure $callback 由于此处 Closure 接受的参数是 Table 类,所以下面调用时封装了一次
  * @return static
  */
 public function whereHas($relation, $callback)
 {
     $this->original->whereHas($relation, function ($query) use($callback) {
         call_user_func($callback, lego_table($query));
     });
     return $this;
 }
Esempio n. 2
0
 /**
  * 关联查询
  * @param $relation
  * @param $callback
  * @return static
  */
 public function whereHas($relation, $callback)
 {
     $this->original->whereHas($relation, $callback);
     return $this;
 }