当前位置: 首页>>代码示例>>PHP>>正文


PHP Prefs::getRoleId方法代码示例

本文整理汇总了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));
 }
开发者ID:awidarto,项目名称:jexadmin,代码行数:28,代码来源:OrderarchiveController.php

示例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) {
开发者ID:awidarto,项目名称:jexadmin,代码行数:31,代码来源:routes.php


注:本文中的Prefs::getRoleId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。