/** * 加入到资源列表 * @param $resourceKey * @param $resourceUrl */ private function addToMap($resourceKey, $resourceUrl) { $resource = ShopResourceFile::whereRaw("resourcekey=:resourcekey", array(":resourcekey" => $resourceKey))->first(); if (!$resource instanceof ShopResourceFile) { $resource = new ShopResourceFile(); } $resource->resourceKey($resourceKey); $resource->resourceUrl($resourceUrl); $resource->save(); }