예제 #1
0
        } else {
            $p = new Parsedevice();
            $p->objectId = $r->getObjectId();
            $p->createdAt = $r->getCreatedAt();
        }
        $p->JEXDeviceId = $r->get('JEXDeviceId');
        $p->appIdentifier = $r->get('appIdentifier');
        $p->appName = $r->get('appName');
        $p->appVersion = $r->get('appVersion');
        $p->deviceBrand = $r->get('deviceBrand');
        $p->deviceType = $r->get('deviceType');
        $p->installationId = $r->get('installationId');
        $p->parseVersion = $r->get('parseVersion');
        $p->timeZone = $r->get('timeZone');
        $p->updatedAt = $r->getUpdatedAt();
        $p->save();
    }
    $pd = Parsedevice::get();
    print_r($pd);
});
Route::get('addrole', function () {
    $members = Member::get();
    foreach ($members as $m) {
        $m->roleId = Prefs::getRoleId('Merchant');
        $m->save();
    }
});
Route::get('impcat', function () {
    $slugs = array('Others' => 'others', 'Music Instruments' => 'music-instruments', 'Electronics' => 'electronics', 'Motorcycle Accessories' => 'motorcycle-accessories', 'Homes and Gardens' => 'homes-and-gardens', 'Pet Supplies' => 'pet-supplies', 'Food & Health' => 'food-health', 'Health & Beauty' => 'health-beauty', 'Watch & Jewelry watch-jewelry', 'Collectibles' => 'collectibles', 'Food & Health' => 'food-health', 'Fashion & Accessories' => 'fashion-accessories', 'Books & Magazines' => 'books-magazines', 'Toys & Games' => 'toys-games', 'Infants & Children' => 'infants-children', 'Sporting Goods' => 'sporting-goods');
    $csvfile = public_path() . '/storage/import/jex_shops2.csv';
    $imp = array();
 public function postSyncparse()
 {
     ParseClient::initialize(Config::get('parse.app_id'), Config::get('parse.rest_key'), Config::get('parse.master_key'));
     $query = ParseInstallation::query();
     //$query = new ParseInstallationQuery();
     $results = $query->find('*');
     $count = 0;
     foreach ($results as $r) {
         $count++;
         $p = Parsedevice::where('objectId', '=', $r->getObjectId())->first();
         if ($p) {
         } else {
             $p = new Parsedevice();
             $p->objectId = $r->getObjectId();
             $p->createdAt = $r->getCreatedAt();
         }
         $p->JEXDeviceId = $r->get('JEXDeviceId');
         $p->appIdentifier = $r->get('appIdentifier');
         $p->appName = $r->get('appName');
         $p->appVersion = $r->get('appVersion');
         $p->deviceBrand = $r->get('deviceBrand');
         $p->deviceType = $r->get('deviceType');
         $p->installationId = $r->get('installationId');
         $p->parseVersion = $r->get('parseVersion');
         $p->timeZone = $r->get('timeZone');
         $p->updatedAt = $r->getUpdatedAt();
         $p->save();
     }
     return Response::json(array('result' => 'OK', 'count' => $count));
 }