本文整理汇总了PHP中Merchant::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Merchant::where方法的具体用法?PHP Merchant::where怎么用?PHP Merchant::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Merchant
的用法示例。
在下文中一共展示了Merchant::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: closedir
closedir($dh);
}
}
}
}
}
});
Route::get('pdf', function () {
$content = "\n <page>\n <h1>Exemple d'utilisation</h1>\n <br>\n Ceci est un <b>exemple d'utilisation</b>\n de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>\n </page>";
$html2pdf = new HTML2PDF();
$html2pdf->WriteHTML($content);
$html2pdf->Output('exemple.pdf', 'D');
});
Route::get('smerchant', function () {
$q = Input::get('term');
$user = Merchant::where('group_id', 4)->where(function ($query) use($q) {
$query->where('merchantname', 'like', '%' . $q . '%')->orWhere('fullname', 'like', '%' . $q . '%');
})->get();
print_r($user->toArray());
});
/*
Route::get('brochure/dl/{id}',function($id){
$prop = Property::find($id)->toArray();
//return View::make('print.brochure')->with('prop',$prop)->render();
$content = View::make('print.brochure')->with('prop',$prop)->render();
//return $content;
示例3: getMerchant
public function getMerchant()
{
$q = Input::get('term');
$user = Merchant::where('group_id', 4)->where(function ($query) use($q) {
$query->where('merchantname', 'like', '%' . $q . '%')->orWhere('fullname', 'like', '%' . $q . '%');
})->get();
$result = array();
foreach ($user->toArray() as $r) {
$result[] = array('id' => $r['id'], 'value' => $r['merchantname'], 'email' => $r['email'], 'label' => $r['merchantname'] . ' ( ' . $r['email'] . ' )');
}
return Response::json($result);
}
示例4: merchantObject
public function merchantObject($merchant_id)
{
$merchant = \Merchant::where('id', '=', $merchant_id)->first();
if ($merchant) {
$merchant = $merchant->toArray();
$nm = array();
foreach ($merchant as $key => $value) {
if (in_array($key, $this->merchant_unset)) {
} else {
$nk = $this->underscoreToCamelCase($key);
$nm[$nk] = is_null($value) ? '' : $value;
}
}
$nm['extId'] = $nm['id'];
unset($nm['id']);
return $nm;
} else {
return array();
}
}
示例5: getMerchant
public static function getMerchant($key = null, $val = null, $order = null, $dir = null)
{
if (is_null($key)) {
$c = Merchant::where('group_id', '=', 4)->orderBy('merchantname', 'asc')->get();
self::$merchant = $c;
return new self();
} else {
$c = Merchant::where($key, '=', $val)->first();
self::$merchant = $c;
return $c;
}
}