本文整理汇总了PHP中Orders::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::where方法的具体用法?PHP Orders::where怎么用?PHP Orders::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orders
的用法示例。
在下文中一共展示了Orders::where方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postCart
public function postCart()
{
date_default_timezone_set('Asia/Shanghai');
$orders = DB::table('orders')->select('id')->get();
foreach ($orders as $p) {
$number = (int) Input::get($p->id);
if ($number > 0) {
$items = Orders::where('id', '=', $p->id)->update(array('PCount' => $number, 'status' => 'ordered', 'SendDate' => date('Y-m-d H:i:s')));
}
}
return Redirect::route('hospital-list')->with('global', '已成功确认订单,并给代理商发送邮件');
$orders = Orders::where('orderNum', '=', Input::get('id'))->groupBy('SId')->get(['SId']);
foreach ($orders as $order) {
$email = User::where('id', '=', $order->SId)->first(['email']);
$stuff = Orders::where('orderNum', '=', Input::get('id'))->where('SId', '=', $order->SId)->get();
Mail::send('email', array('stuffs' => $stuff, 'email'), function ($message) use($email, $stuff) {
$message->from('botenv@126.com', 'Laravel');
$message->to($email->email, 'John Smith')->subject('订单: ' . $stuff[0]->orderNum);
});
echo $stuff;
}
return Redirect::route('hospital-list')->with('global', '已成功确认订单,并给代理商发送邮件');
}
示例2: postScan
public function postScan()
{
$input = Input::get();
$barcode = $input['product'];
$type = '';
date_default_timezone_set('Asia/Shanghai');
if (array_key_exists('mac', $input)) {
$scanner = DB::table('scanner')->where('mac', '=', $input['mac'])->first();
$id = $scanner->userId;
$username = $scanner->username;
} else {
$id = Cache::get('id');
$username = Cache::get('username');
}
if (strcmp(substr($barcode, 0, 2), '01') == 0) {
$type = 'GS1-128-primary';
} else {
if (strcmp(substr($barcode, 0, 2), '17') == 0) {
$type = 'GS1-128-secondary';
} else {
if ($barcode[0] == '+') {
$type = 'HIBC';
} else {
if (strlen($barcode) == 13 && $barcode[0] == '6') {
$type = 'EAN-13';
}
}
}
}
if (strcmp($type, 'GS1-128-primary') == 0) {
Cache::put('PBarPrimary', $barcode, 10);
$a = array('Mcode' => substr($barcode, 3, 8), 'huohao' => substr($barcode, 12, 4));
} else {
if (strcmp($type, 'GS1-128-secondary') == 0) {
$PBarPrimary = Cache::get('PBarPrimary');
Cache::forget('PBarPrimary');
$order = Orders::where('PBarcode', '=', $PBarPrimary)->where('SId', '=', $id)->first();
if ((int) $order->PCount <= (int) $order->actual) {
//Scanner Cannot go into Redirect without proper Cookies
if (!array_key_exists('mac', $input)) {
return Redirect::to(URL::route('incomplete'));
} else {
return;
}
}
$date_start = strpos($barcode, '17') + 2;
$date_length = 6;
$date = date_create_from_format('Ymd H:i:s', '20' . substr($barcode, $date_start, $date_length) . ' 00:00:00');
$lot_start = strpos($barcode, '10') + 2;
if (strpos($barcode, '91') || strpos($barcode, '21')) {
if (strpos($barcode, '91')) {
$lot_length = strpos($barcode, '91') - strpos($barcode, '10') - 2;
$lot = substr($barcode, $lot_start, $lot_length);
$serial_start = strpos($barcode, '91') + 2;
$serial = substr($barcode, $serial_start);
} else {
$lot_length = strpos($barcode, '21') - strpos($barcode, '10') - 2;
$lot = substr($barcode, $lot_start, $lot_length);
$serial_start = strpos($barcode, '21') + 2;
$serial = substr($barcode, $serial_start);
}
} else {
$lot = substr($barcode, $lot_start);
$serial = ' ';
}
SecondaryBar::create(array('orderNum' => $order->orderNum, 'PBarcode' => $order->PBarcode, 'PBarSecondary' => $barcode, 'expire' => date_format($date, 'Y-m-d H:i:s'), 'lot' => $lot, 'SerialNum' => $serial));
$order->SUser = $username;
$order->actual = $order->actual + 1;
$order->save();
} else {
if (strcmp($type, 'HIBC') == 0) {
if (strcmp(substr($barcode, 0, 2), '+H') == 0) {
Cache::put('PBarPrimary', $barcode, 10);
} else {
$PBarPrimary = Cache::get('PBarPrimary');
Cache::forget('PBarPrimary');
$order = Orders::where('PBarcode', '=', $PBarPrimary)->where('SId', '=', $id)->first();
if ((int) $order->PCount <= (int) $order->actual) {
//Scanner Cannot go into Redirect without proper Cookies
if (!array_key_exists('mac', $input)) {
return Redirect::to(URL::route('incomplete'));
} else {
return;
}
}
$exp = '0000-00-00 00:00:00';
if ($barcode[1] != '$') {
$len = strlen($barcode) - 8;
$exp = date_create_from_format('z Y', substr($barcode, 3, 3) . ' 20' . substr($barcode, 1, 2));
$lot = substr($barcode, 6, $len);
} else {
if ($barcode[1] == '$' && $barcode[2] != '$') {
$len = strlen($barcode) - 4;
$lot = substr($barcode, 2, $len);
} else {
if ($barcode[1] == '$' && $barcode[2] == '$' && $barcode[3] != '+') {
switch ($barcode[3]) {
case '2':
$len = strlen($barcode) - 12;
$exp = date_create_from_format('Y-m-d', '20' . substr($barcode, 8, 2) . '-' . substr($barcode, 4, 2) . '-' . substr($barcode, 6, 2));
//.........这里部分代码省略.........
示例3: address
public function address(Request $request, $id = 0)
{
header("Content-Type:text/html;charset=utf-8");
if ($id == 0) {
echo "参数错误,没有找到订单";
exit;
}
//这个地方,需要判断一下有没有tendree的权限
// echo "userid=".Auth::user()->id;
$order = Orders::where("id", "=", $id)->where("userid", "=", Auth::user()->id)->where("step", "=", 2)->first();
//只有支付到了第二段才有可能去选地址
if ($order == null) {
echo "参数错误,没有找到订单";
exit;
}
$uid = Auth::user()->id;
$useraddrs = Address::where("user_id", "=", $uid)->get();
$provices = Area::whereRaw('parent_id=1')->orderby('id', 'asc')->get();
$areas = Area::whereRaw('1=1')->orderBy('id', 'desc')->get();
$order = Orders::findOrFail($id);
$data = array('order' => $order, 'areas' => $areas, 'provices' => $provices, 'useraddrs' => $useraddrs);
return view('pay.address', $data);
}
示例4: encounters_view
//.........这里部分代码省略.........
$data['ros'] .= '<strong>PTSD: </strong>';
$data['ros'] .= nl2br($rosInfo->ros_psych6);
$data['ros'] .= '<br /><br />';
}
if ($rosInfo->ros_psych7 != '') {
$data['ros'] .= '<strong>Substance Related Disorder: </strong>';
$data['ros'] .= nl2br($rosInfo->ros_psych7);
$data['ros'] .= '<br /><br />';
}
if ($rosInfo->ros_psych8 != '') {
$data['ros'] .= '<strong>Obsessive Compulsive Disorder: </strong>';
$data['ros'] .= nl2br($rosInfo->ros_psych8);
$data['ros'] .= '<br /><br />';
}
if ($rosInfo->ros_psych9 != '') {
$data['ros'] .= '<strong>Social Anxiety Disorder: </strong>';
$data['ros'] .= nl2br($rosInfo->ros_psych9);
$data['ros'] .= '<br /><br />';
}
if ($rosInfo->ros_psych10 != '') {
$data['ros'] .= '<strong>Autistic Disorder: </strong>';
$data['ros'] .= nl2br($rosInfo->ros_psych10);
$data['ros'] .= '<br /><br />';
}
if ($rosInfo->ros_psych11 != '') {
$data['ros'] .= "<strong>Asperger's Disorder: </strong>";
$data['ros'] .= nl2br($rosInfo->ros_psych11);
$data['ros'] .= '<br /><br />';
}
$data['ros'] .= '</p>';
} else {
$data['ros'] = '';
}
$ohInfo = DB::table('other_history')->where('eid', '=', $eid)->first();
if ($ohInfo) {
$data['oh'] = '<br><h4>Other Pertinent History:</h4><p class="view">';
if ($ohInfo->oh_pmh != '') {
$data['oh'] .= '<strong>Past Medical History: </strong>';
$data['oh'] .= nl2br($ohInfo->oh_pmh);
$data['oh'] .= '<br /><br />';
}
if ($ohInfo->oh_psh != '') {
$data['oh'] .= '<strong>Past Surgical History: </strong>';
$data['oh'] .= nl2br($ohInfo->oh_psh);
$data['oh'] .= '<br /><br />';
}
if ($ohInfo->oh_fh != '') {
$data['oh'] .= '<strong>Family History: </strong>';
$data['oh'] .= nl2br($ohInfo->oh_fh);
$data['oh'] .= '<br /><br />';
}
if ($ohInfo->oh_sh != '') {
$data['oh'] .= '<strong>Social History: </strong>';
$data['oh'] .= nl2br($ohInfo->oh_sh);
$data['oh'] .= '<br /><br />';
}
if ($ohInfo->oh_etoh != '') {
$data['oh'] .= '<strong>Alcohol Use: </strong>';
$data['oh'] .= nl2br($ohInfo->oh_etoh);
$data['oh'] .= '<br /><br />';
}
if ($ohInfo->oh_tobacco != '') {
$data['oh'] .= '<strong>Tobacco Use: </strong>';
$data['oh'] .= nl2br($ohInfo->oh_tobacco);
$data['oh'] .= '<br /><br />';
}
示例5: getOrderDetailsbyPaydueId
static function getOrderDetailsbyPaydueId($paydueId)
{
return Orders::where('payment_dues_id', '=', $paydueId)->get();
}
示例6: printBdayOrder
public function printBdayOrder($oid)
{
$orderid = Crypt::decrypt($oid);
$order_data = Orders::where('orders.id', '=', $orderid)->get();
$customer_data = Customers::where('id', '=', $order_data[0]['customer_id'])->get();
$birthday_data = BirthdayParties::where('id', '=', $order_data[0]['birthday_id'])->get();
$student_data = Students::where('id', '=', $order_data[0]['student_id'])->get();
$order_data = $order_data[0];
if (isset($order_data['payment_dues_id'])) {
$payment_due_data = PaymentDues::where('id', '=', $order_data['payment_dues_id'])->get();
$payment_due_data = $payment_due_data[0];
if (isset($payment_due_data->membership_id)) {
$membershipData = CustomerMembership::find($payment_due_data->membership_id);
$membershipTypeData = MembershipTypes::getMembershipTypeByID($membershipData->membership_type_id);
$payment_due_data->description = $membershipTypeData->description;
}
}
$customer_data = $customer_data[0];
$birthday_data = $birthday_data[0];
$student_data = $student_data[0];
$data = array('order_data', 'customer_data', 'birthday_data', 'student_data', 'payment_due_data');
// print_r($data);
return View::make('pages.orders.bdayprintorder', compact($data));
}
示例7: getSumAllOrders
public function getSumAllOrders($packageID, $dateFrom, $dateTo)
{
$order = Orders::where('order_packageid', $packageID)->where('order_datefrom', $dateFrom)->where('order_dateto', $dateTo)->count();
return $order;
}