Ejemplo n.º 1
0
 /**
  * @param $domain
  * @param $type
  *
  * @return Store|Validator
  */
 public function create($domain, $type)
 {
     $domain = $this->fixDomain($domain);
     $identifier = $this->convertDomainToIdentifier($domain);
     $type = $this->storeTypeRepo->getByName($type);
     return Store::create(['identifier' => $identifier, 'domain' => $domain, 'type_id' => $type->getId(), 'account_id' => \Auth::user()->getAccountId(), 'auth_state' => Store::STATE_PENDING]);
 }
Ejemplo n.º 2
0
 public function store(Request $request)
 {
     $keys = 'id,name,address,phone,agent_ids,brand_ids';
     $data = $this->autoValidate($request, 'store.store', $keys);
     $agent_ids = array_pull($data, 'agent_ids');
     $brand_ids = array_pull($data, 'brand_ids');
     $store = Store::create($data);
     $store->agents()->sync($agent_ids);
     $store->brands()->sync($brand_ids);
     return $this->success('', url('admin/store'));
 }
Ejemplo n.º 3
0
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $store = Store::create(['name' => '锐思达健身会所(帝苑店)', 'mobile' => '86 591 87623888', 'address' => '福州市五四路9号宁德大厦7F', 'lat' => '26.23141231', 'lng' => '112.32141310', 'description' => '锐思达健身位于福州五四路宁德大厦7楼,是帝苑企业多元化发展的全新品牌。 锐思达是一个集健身、舒心为一体的都市精锐全新空间。以关注都市箐英身心健康为核心理念,致力于营造一个精致时尚的健身环境。福建首家拥有国际顶尖设备,贴心客户经理与私人教练的服务,为客户尽兴提供每一刻的专属服务;悉心定制的运动营养套餐,在保证品质的同时,更强调合理的营养搭配。

锐思达的空间设计极致,简约中不失调性,清晰的功能区域规划、灵动的空间布局,精巧中透露时尚气息。VIP私教套房,专属您的私密空间,尊享总统套房般的服务。

锐思达秉承帝苑集团“健康、欢乐、时尚”的经营理念,倡导做生活的减法,让生活更优质,为身心灵全面减压,回归最初的宁静。', 'startup_at' => '2015-10-10 00:00:00']);
        $store1 = Store::create(['name' => '锐思达动能馆(文化宫店)', 'mobile' => '86 591 87623999', 'address' => '福州市八一七路766号文化宫1F&B1F', 'lat' => '26.12645434', 'lng' => '112.12312410', 'description' => '坐落于台江区八一七中路766号文化宫的Restart锐思达动能馆,是锐思达健身会所面向大众化的全新支线品牌。

福州锐思达动能馆占地总面积达8500多平米,7300平方米健身房+1200平米国家标准恒温泳池,是一个让您在辛苦锻炼之余,能享受健身乐趣的空间。福州锐思达动能馆不仅仅向大众提供了现代化的健身环境和先进的健身方式,更是力求通过健身把真正核心的健康理念带给会员。希望会员在自身变化中,拥有对于健康生活的切身体会和理解,在日常的工作和生活中可以真正去实践健康的生活方式。

锐思达动能馆秉承Restart的宗旨,将一切美好愿望都渗透进了具体服务中。锐思达用心RESTART您在动能馆的每时每刻!', 'startup_at' => '2015-11-11 00:00:00']);
    }
Ejemplo n.º 4
0
 public function doAudit()
 {
     if ($this->audited) {
         return false;
     }
     $agent = Agent::find($this->aid);
     if (empty($agent)) {
         return false;
     }
     $user = (new User())->get($this->username) ?: (new User())->add(['username' => $this->username, 'password' => substr($this->idcard, -6), 'realname' => $this->realname, 'idcard' => $this->idcard, 'phone' => $this->username], Role::STORE);
     $store = Store::find($user->getKey()) ?: Store::create(['id' => $user->getKey(), 'name' => $this->name, 'phone' => $this->phone, 'address' => $this->address]);
     $user->roles()->sync([Role::where('name', Role::STORE)->firstOrFail()->getKey()], false);
     $agent->stores()->sync([$store->getKey()], false);
     $store->brands()->sync($this->brand_ids, false);
     $this->audited = true;
     $this->save();
     return true;
 }
Ejemplo n.º 5
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(StoreRequest $request)
 {
     $data = $request->all();
     if ($request->hasFile('img_pp')) {
         $file = $request->file('img_pp');
         $fileName = time() . '-' . $file->getClientOriginalName();
         $file->move('uploads', $fileName);
         $data['pp'] = $fileName;
     }
     if ($request->hasFile('img-cover')) {
         $file = $request->file('img-cover');
         $fileName = time() . '-' . $file->getClientOriginalName();
         $file->move('uploads', $fileName);
         $data['cover'] = $fileName;
     }
     $data['user_id'] = Auth::user()->id;
     $store = Store::create($data);
     return redirect('store/' . $store->id);
 }
Ejemplo n.º 6
0
 public function addStore(request $request)
 {
     $validator = Validator::make($request->all(), ['name' => 'required|max:255|unique:stores', 'address' => 'required|min:10', 'code' => 'required|unique:stores', 'cost' => 'required', 'timer' => 'required|max:200', 'is_active' => 'required', 'offer_image' => 'required|max:1000|mimes:jpeg,jpg,png']);
     if ($validator->fails()) {
         return redirect('admin/store/add')->withErrors($validator);
     }
     $store = Store::create($request->only('name', 'address', 'code', 'cost', 'timer', 'is_active'));
     $image = $request->file('offer_image');
     $imageName = strtotime(Carbon::now()) . md5($store->id) . '.' . $image->getClientOriginalExtension();
     $path = public_path('assets/img/stores/' . $imageName);
     Image::make($image->getRealPath())->resize(280, 240)->save($path);
     $store->offer_image = $imageName;
     $store->save();
     return redirect('admin/store/' . $store->id);
 }
Ejemplo n.º 7
0
    /**
     * save articles for a page which display list.
     * @param $url
     * @param $category_id
     */
    protected function saveCoupons($url, $category_id)
    {
        $response = $this->crawlerLink($url);
        $crawler = new Crawler($response);
        $coupons = $crawler->filter('div#show_coupons > article');
        $data = [];
        foreach ($coupons as $i => $item) {
            $itemCrawler = new Crawler($item);

            $temp = $itemCrawler->filter('div.col-md-10 > div.shop-at > a')->attr('href');
            $temp = str_replace('http://www.mostcoupon.com/', '', $temp);
            $temp = str_replace('-coupons', '', $temp);
            $store = Store::where('slug', trim($temp))->first();
            if (!$store) {
                $name = $itemCrawler->filter('div.col-md-10 > div.shop-at > a')->text();
                $image = $itemCrawler->filter('div.logo > img')->attr('src');
                $image = $this->downloadImage($image);
                $store = Store::create(['name' => $name, 'logo' => $image, 'category_id' => $category_id]);
            }
            $data[$i]['event_id'] = 1;
            $data[$i]['store_id'] = $store->id;
            $data[$i]['title'] = $itemCrawler->filter('div.col-md-10 > p.title')->text();


            try {
                $expired = $itemCrawler->filter('div.col-md-10 > div.expries > span.note')->text();
                $data[$i]['expired_date'] = str_replace('End: ', '', $expired);
            } catch(InvalidArgumentException $e) {}

            try {
                $data[$i]['coupon_code'] = $itemCrawler->filter('div.get-code > div.action-mask  div.action-wrap > p')->text();
                $data[$i]['coupon_type'] = 'code';
            } catch (InvalidArgumentException $e) {
                if ($itemCrawler->filter('div.get-code > div.action-mask > span.action')->text() == 'Free Shipping') {
                    $data[$i]['coupon_type'] = 'ship';
                } else {
                    $data[$i]['coupon_type'] = 'deal';
                }
            }

            $data[$i]['desc'] = $itemCrawler->filter('div.description > p.description')->html();
            $temp = $itemCrawler->filter('div.information > span.expries')->text();
            $data[$i]['published_date'] = str_replace('Publish: ', '', $temp);
            try {
                Coupon::create($data[$i]);
            } catch(QueryException $e) {

            }
        }
    }
Ejemplo n.º 8
0
 /**
  * Create a new store.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|max:255']);
     Store::create(['name' => $request->name]);
     return redirect('/stores');
 }