本文整理匯總了PHP中app\Member::join方法的典型用法代碼示例。如果您正苦於以下問題:PHP Member::join方法的具體用法?PHP Member::join怎麽用?PHP Member::join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Member
的用法示例。
在下文中一共展示了Member::join方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSearch
public function getSearch(Request $request)
{
// $userid = $request->input('userid', '');
$pid = $request->input('pid', '');
$start = $request->input('start', '');
$end = $request->input('end', '');
$warn_type = $request->input('warn_type', '');
$set = Member::join('data_warn_save', 'data_warn_save.userid', '=', 'member.id')->select('*')->addSelect('member.userid');
if ($warn_type) {
$set = $set->where('data_warn_save.type', '=', $warn_type);
}
if ($pid) {
$set = $set->where('member.pid', 'like', '%' . $pid . '%');
}
if ($start) {
$set = $set->where('data_warn_save.time', '>=', strtotime($start));
}
if ($end) {
$set = $set->where('data_warn_save.time', '<', strtotime($end) + 3600 * 24);
}
if (\Auth::user()->user_type != 0) {
$set = $set->where('member.fid', '=', \Auth::user()->id);
}
return view('warning.index')->with(['items' => $set->paginate(10), 'warn_type' => $warn_type, 'pid' => $pid, 'start' => $start, 'end' => $end]);
}
示例2: getSearch
public function getSearch(Request $request)
{
$pid = $request->input('pid', '');
$userid = $request->input('userid', '');
$saled = $request->input('saled', '');
$status = $request->input('status', '');
//$active = $request->input('check')[2];
//查時間數據庫開銷太大,故沒加
$set = Member::join('product_ext', 'product_ext.pid', '=', 'member.pid')->select('*');
if ($pid) {
$set = $set->where('member.pid', 'like', '%' . $pid . '%');
}
if ($userid) {
$set = $set->where('member.userid', 'like', '%' . $userid . '%');
}
if ($saled != '') {
$set = $set->where('saled', $saled);
}
if ($status != '') {
$set = $set->where('member.status', $status);
}
if (\Auth::user()->user_type != 0) {
$set = $set->where('fid', '=', \Auth::user()->id);
}
return view('watch.index')->with(['items' => $set->paginate(10), 'pid' => $pid, 'userid' => $userid, 'saled' => $saled, 'status' => $status]);
}