當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Box::whereIn方法代碼示例

本文整理匯總了PHP中Box::whereIn方法的典型用法代碼示例。如果您正苦於以下問題:PHP Box::whereIn方法的具體用法?PHP Box::whereIn怎麽用?PHP Box::whereIn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Box的用法示例。


在下文中一共展示了Box::whereIn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postChangestatus

 public function postChangestatus()
 {
     $in = Input::get();
     $results = Box::whereIn('_id', $in['box_ids'])->get();
     $delivery_status = $in['delivery_status'];
     $courier_status = $in['courier_status'];
     $warehouse_status = $in['warehouse_status'];
     $position = $in['position'];
     $note = $in['note'];
     date_default_timezone_set('Asia/Jakarta');
     $res = false;
     $ts = new MongoDate();
     $setpendingcount = array();
     foreach ($results as $bx) {
         $prebx = clone $bx;
         $sh = Shipment::where('delivery_id', '=', $bx->delivery_id)->first();
         //$sh->pick_up_date = new MongoDate(strtotime($in['date'])) ;
         if ($sh) {
             $pre = clone $sh;
             if (is_null($delivery_status) || $delivery_status == '') {
             } else {
                 $sh->status = $delivery_status;
                 $sh->last_action_ts = $ts;
                 $sh->last_action = 'Change Status by Admin';
                 $sh->last_reason = $in['reason'];
                 $this->saveDeliveryNote($delivery_status, $note, $ts, $sh);
                 if ($delivery_status == Config::get('jayon.trans_status_mobile_pending')) {
                     if (in_array($sh->delivery_id, $setpendingcount)) {
                     } else {
                         $sh->pending_count = $sh->pending_count + 1;
                     }
                     $setpendingcount[] = $sh->delivery_id;
                     $setpendingcount = array_unique($setpendingcount);
                 }
             }
             if (is_null($courier_status) || $courier_status == '') {
             } else {
                 $sh->courier_status = $courier_status;
             }
             if (is_null($warehouse_status) || $warehouse_status == '') {
             } else {
                 $sh->warehouse_status = $warehouse_status;
             }
             if (is_null($position) || $position == '') {
             } else {
                 $sh->position = $position;
             }
             $sh->last_action_ts = $ts;
             $sh->last_action = 'Change Status';
             $sh->last_reason = $in['reason'];
             $sh->save();
             $hdata = array();
             $hdata['historyTimestamp'] = $ts;
             $hdata['historyAction'] = 'change_status';
             $hdata['historySequence'] = 1;
             $hdata['historyObjectType'] = 'shipment';
             $hdata['historyObject'] = $sh->toArray();
             $hdata['actor'] = Auth::user()->fullname;
             $hdata['actor_id'] = Auth::user()->_id;
             History::insert($hdata);
             $sdata = array();
             $sdata['timestamp'] = $ts;
             $sdata['action'] = 'change_status';
             $sdata['reason'] = $in['reason'];
             $sdata['objectType'] = 'shipment';
             $sdata['object'] = $sh->toArray();
             $sdata['preObject'] = $pre->toArray();
             $sdata['actor'] = Auth::user()->fullname;
             $sdata['actor_id'] = Auth::user()->_id;
             Shipmentlog::insert($sdata);
         }
         if (is_null($delivery_status) || $delivery_status == '') {
         } else {
             $bx->deliveryStatus = $delivery_status;
         }
         if (is_null($courier_status) || $courier_status == '') {
         } else {
             $bx->courierStatus = $courier_status;
         }
         if (is_null($warehouse_status) || $warehouse_status == '') {
         } else {
             $bx->warehouseStatus = $warehouse_status;
         }
         if (is_null($position) || $position == '') {
         } else {
             $bx->position = $position;
         }
         $bx->save();
         $hdata = array();
         $hdata['historyTimestamp'] = $ts;
         $hdata['historyAction'] = 'change_status';
         $hdata['historySequence'] = 1;
         $hdata['historyObjectType'] = 'box';
         $hdata['historyObject'] = $bx->toArray();
         $hdata['actor'] = Auth::user()->fullname;
         $hdata['actor_id'] = Auth::user()->_id;
         History::insert($hdata);
         $sdata = array();
         $sdata['timestamp'] = $ts;
         $sdata['action'] = 'change_status';
//.........這裏部分代碼省略.........
開發者ID:awidarto,項目名稱:bilnatracker,代碼行數:101,代碼來源:AjaxController.php


注:本文中的Box::whereIn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。