/** * slider引用检查 * @param $appId * @param $local * @throws DeepInException */ protected function checkSliderReferred($appId, $local) { $slider = ShopSlider::whereRaw("itemtype=1 and itemid=:itemid", array(":itemid" => $appId))->get(); $locals = array(); foreach ($slider as $v) { if ($v instanceof ShopSlider) { $locals[] = $v->local(); } } if (in_array($local, $locals)) { throw new DeepInException("大图轮播里面提交引用到该应用~!"); } }