/** * 换序 * @param $query * @return mixed */ public function scopeHx($query) { $made = new Made(); $farb = $made->farb($this->key); foreach ($farb as $v) { $query->OrWhere('name', $v); } return $query; }
public function scopeBhcx($query) { $made = new Made(); $key_array = $made->splitWord($this->key); $made->getSort($key_array); foreach ($made->getSort($key_array) as $v) { $query->orWhere('title', 'like', '%' . $this->key . '%'); var_dump($made->getSort($v)); } return $query; }