本文整理汇总了PHP中Prefs::getRoleId方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::getRoleId方法的具体用法?PHP Prefs::getRoleId怎么用?PHP Prefs::getRoleId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prefs
的用法示例。
在下文中一共展示了Prefs::getRoleId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postSynclegacy
public function postSynclegacy()
{
set_time_limit(0);
$mymerchant = Merchant::where('group_id', 4)->get();
$count = 0;
foreach ($mymerchant->toArray() as $m) {
$member = Member::where('legacyId', $m['id'])->first();
if ($member) {
} else {
$member = new Member();
}
foreach ($m as $k => $v) {
$member->{$k} = $v;
}
if (!isset($member->status)) {
$member->status = 'inactive';
}
if (!isset($member->url)) {
$member->url = '';
}
$member->legacyId = new MongoInt32($m['id']);
$member->roleId = Prefs::getRoleId('Merchant');
$member->unset('id');
$member->save();
$count++;
}
return Response::json(array('result' => 'OK', 'count' => $count));
}
示例2: print_r
$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();
Excel::load($csvfile, function ($reader) use(&$imp) {
$imp = $reader->toArray();
})->get();
print_r($imp);
$count = 0;
foreach ($imp as $s) {
$m = Member::where('id', strval($s['id']))->first();
if ($m) {