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


PHP Box::where方法代码示例

本文整理汇总了PHP中Box::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Box::where方法的具体用法?PHP Box::where怎么用?PHP Box::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Box的用法示例。


在下文中一共展示了Box::where方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $dbox = Boxstatus::where('appname', '=', Config::get('jex.tracker_app'))->where('deliveryStatus', '=', Config::get('jayon.trans_status_mobile_delivered'))->get();
     if ($dbox) {
         foreach ($dbox as $dbx) {
             print 'box status : ' . $dbx->deliveryId . ' ' . $dbx->boxId . ' ' . $dbx->deliveryStatus . "\r\n";
             $box = Box::where('delivery_id', '=', $dbx->deliveryId)->where(function ($q) use($dbx) {
                 $q->where('box_id', '=', intval($dbx->boxId))->orWhere('box_id', '=', strval($dbx->boxId));
             })->first();
             if ($box) {
                 print 'box before : ' . $box->delivery_id . ' ' . $box->box_id . ' ' . $box->deliveryStatus . "\r\n";
                 $box->deliveryStatus = $dbx->deliveryStatus;
                 print 'box after : ' . $box->delivery_id . ' ' . $box->box_id . ' ' . $box->deliveryStatus . "\r\n";
                 $box->save();
             }
         }
     }
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:23,代码来源:Backtrack.php

示例2: postBoxlist

 public function postBoxlist()
 {
     $in = Input::get();
     $ids = $in['ids'];
     $shipments = Shipment::whereIn('_id', $in['ids'])->get();
     $shipments = $shipments->toArray();
     for ($i = 0; $i < count($shipments); $i++) {
         $pick_up_date = $shipments[$i]['pick_up_date'];
         $shipments[$i]['pick_up_date'] = date('Y-m-d', $shipments[$i]['pick_up_date']->sec);
         $boxes = Box::where('fulfillment_code', '=', $shipments[$i]['fulfillment_code'])->where('order_id', '=', $shipments[$i]['order_id'])->where('delivery_id', '=', $shipments[$i]['delivery_id'])->get();
         $boxlist = array();
         foreach ($boxes as $d) {
             $boxlist[$d->_id]['_id'] = $d->_id;
             $boxlist[$d->_id]['fulfillment_code'] = $d->fulfillment_code;
             $boxlist[$d->_id]['deliveryStatus'] = $d->deliveryStatus;
             $boxlist[$d->_id]['courierStatus'] = $d->courierStatus;
             $boxlist[$d->_id]['box_id'] = $d->box_id;
         }
         $shipments[$i]['box_list'] = $boxlist;
     }
     return Response::json(array('result' => 'OK', 'shipment' => $shipments, 'boxes' => $boxlist));
     //print_r($caps);
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:23,代码来源:AjaxController.php

示例3: boxList

 public function boxList($field, $val, $device_key, $obj = false)
 {
     $boxes = \Box::where($field, '=', $val)->get();
     $bx = array();
     if ($obj == true) {
         $boxes = $boxes->toArray();
         for ($n = 0; $n < count($boxes); $n++) {
             $ob = new \stdClass();
             foreach ($boxes[$n] as $k => $v) {
                 if ($k != '_id' && $k != 'id') {
                     $nk = $this->underscoreToCamelCase($k);
                 } else {
                     $nk = $k;
                 }
                 $ob->{$nk} = is_null($v) ? '' : $v;
             }
             //print_r($ob);
             $ob->extId = $ob->_id;
             unset($ob->_id);
             $ob->status = $this->lastBoxStatus($device_key, $ob->deliveryId, $ob->fulfillmentCode, $ob->boxId);
             $boxes[$n] = $ob;
         }
         return $boxes;
     } else {
         foreach ($boxes as $b) {
             $bx[] = $b->box_id;
         }
         if (count($bx) > 0) {
             return implode(',', $bx);
         } else {
             return '1';
         }
     }
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:34,代码来源:AwbController.php

示例4: boxList

 public function boxList($field, $val)
 {
     $boxes = \Box::where($field, '=', $val)->get();
     $bx = array();
     foreach ($boxes as $b) {
         $bx[] = $b->box_id;
     }
     if (count($bx) > 0) {
         return implode(',', $bx);
     } else {
         return '1';
     }
 }
开发者ID:awidarto,项目名称:jexadmin,代码行数:13,代码来源:AwbController.php

示例5: postBox

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function postBox()
 {
     $key = \Input::get('key');
     $appname = \Input::has('app') ? \Input::get('app') : 'app.name';
     //$user = \Apiauth::user($key);
     $user = \Device::where('key', '=', $key)->first();
     if (!$user) {
         $actor = 'no id : no name';
         \Event::fire('log.api', array($this->controller_name, 'post', $actor, 'device not found, upload image failed'));
         return \Response::json(array('status' => 'ERR:NODEVICE', 'timestamp' => time(), 'message' => 'Device Unregistered'));
     }
     $json = \Input::all();
     $batch = \Input::get('batch');
     $result = array();
     foreach ($json as $j) {
         //$j['mtimestamp'] = new \MongoDate(time());
         if (is_array($j)) {
             $blog = new \Boxid();
             foreach ($j as $k => $v) {
                 $blog->{$k} = $v;
             }
             $blog->appname = $appname;
             $blog->mtimestamp = new \MongoDate(time());
             $box = \Box::where('delivery_id', '=', $blog->deliveryId)->where('merchant_trans_id', '=', $blog->merchantTransId)->where('fulfillment_code', '=', $blog->fulfillmentCode)->where('box_id', '=', $blog->boxId)->first();
             if ($box) {
                 if ($appname == \Config::get('jex.pickup_app')) {
                     $box->pickupStatus = $blog->pickupStatus;
                 } elseif ($appname == \Config::get('jex.hub_app')) {
                     $box->warehouseStatus = $blog->warehouseStatus;
                 } else {
                     $box->deliveryStatus = $blog->deliveryStatus;
                     $box->courierStatus = $blog->courierStatus;
                 }
                 $box->save();
             }
             $r = $blog->save();
             if ($r) {
                 $result[] = array('status' => 'OK', 'timestamp' => time(), 'message' => 'log inserted');
             } else {
                 $result[] = array('status' => 'NOK', 'timestamp' => time(), 'message' => 'insertion failed');
             }
         }
     }
     //print_r($result);
     //die();
     $actor = $user->identifier . ' : ' . $user->devname;
     \Event::fire('log.api', array($this->controller_name, 'get', $actor, 'sync scan log'));
     return Response::json($result);
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:54,代码来源:SyncapiController.php

示例6: statusList

 public function statusList($data)
 {
     $boxes = Box::where('delivery_id', $data['delivery_id'])->get();
     $bcount = 0;
     $dcount = 0;
     $rcount = 0;
     $pcount = 0;
     $dclass = '';
     $rclass = '';
     $pclass = '';
     if ($data['status'] == Config::get('jayon.trans_status_mobile_delivered_partial') || $data['status'] == Config::get('jayon.trans_status_mobile_delivered') || $data['status'] == Config::get('jayon.trans_status_mobile_return') || $data['status'] == Config::get('jayon.trans_status_mobile_pending')) {
         foreach ($boxes as $box) {
             if ($box->deliveryStatus == Config::get('jayon.trans_status_mobile_delivered')) {
                 $dcount++;
             }
             if ($box->deliveryStatus == Config::get('jayon.trans_status_mobile_return')) {
                 $rcount++;
             }
             if ($box->deliveryStatus == Config::get('jayon.trans_status_mobile_pending')) {
                 $pcount++;
             }
         }
         $bcount = count($boxes);
         $dclass = $dcount == 0 ? 'lightgrey' : '';
         $rclass = $rcount == 0 ? 'lightgrey' : '';
         $pclass = $pcount == 0 ? 'lightgrey' : '';
         /*
                     if(count($boxes) > ($dcount + $rcount) && $data['logistic_type'] == 'internal'){
                         $data['status'] = Config::get('jayon.trans_status_mobile_delivered_partial');
                     }*/
     }
     $slist = array(Prefs::colorizestatus($data['status'], 'delivery') . '<br /><span class="badge">BX:' . $bcount . '</span> <span class="badge ' . $dclass . ' ">D:' . $dcount . '</span> <span class="badge ' . $rclass . ' ">R:' . $rcount . '</span> <span class="badge ' . $pclass . '">P:' . $pcount . '</span>');
     return implode('<br />', $slist);
     //return '<span class="orange white-text">'.$data['status'].'</span><br /><span class="brown">'.$data['pickup_status'].'</span><br /><span class="green">'.$data['courier_status'].'</span><br /><span class="maroon">'.$data['warehouse_status'].'</span>';
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:35,代码来源:DeliveredController.php

示例7: dlstatusList

 public function dlstatusList($data)
 {
     $boxes = Box::where('delivery_id', $data['delivery_id'])->get();
     $bcount = 0;
     $dcount = 0;
     $rcount = 0;
     $pcount = 0;
     if ($data['status'] == Config::get('jayon.trans_status_mobile_delivered_partial') || $data['status'] == Config::get('jayon.trans_status_mobile_delivered') || $data['status'] == Config::get('jayon.trans_status_mobile_return') || $data['status'] == Config::get('jayon.trans_status_mobile_pending')) {
         foreach ($boxes as $box) {
             if ($box->deliveryStatus == Config::get('jayon.trans_status_mobile_delivered')) {
                 $dcount++;
             }
             if ($box->deliveryStatus == Config::get('jayon.trans_status_mobile_return')) {
                 $rcount++;
             }
             if ($box->deliveryStatus == Config::get('jayon.trans_status_mobile_pending')) {
                 $pcount++;
             }
         }
         $bcount = count($boxes);
         if (count($boxes) > $dcount + $rcount && $data['logistic_type'] == 'internal') {
             $data['status'] = Config::get('jayon.trans_status_mobile_delivered_partial');
         }
     }
     //$slist = array(
     //    $data['status'].' BOX:'.$bcount.' D:'.$dcount.' R:'.$rcount.' P:'.$pcount
     //);
     return $data['status'] . ' BOX:' . $bcount . ' D:' . $dcount . ' R:' . $rcount . ' P:' . $pcount;
     //return implode(' | ', $slist);
     //return '<span class="orange white-text">'.$data['status'].'</span><br /><span class="brown">'.$data['pickup_status'].'</span><br /><span class="green">'.$data['courier_status'].'</span><br /><span class="maroon">'.$data['warehouse_status'].'</span>';
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:31,代码来源:DispatchedController.php

示例8: save_box

 public static function save_box($delivery_id, $merchant_trans_id, $fulfillment_code, $count)
 {
     $affected = Box::where('delivery_id', '=', $delivery_id)->where('merchant_trans_id', '=', $merchant_trans_id)->where('fulfillment_code', '=', $fulfillment_code)->delete();
     for ($i = 0; $i < $count; $i++) {
         $bd = new Box();
         $bd->delivery_id = $delivery_id;
         $bd->merchant_trans_id = $merchant_trans_id;
         $bd->fulfillment_code = $fulfillment_code;
         $bd->box_id = $i + 1;
         $bd->save();
         $bds = new Boxstatus();
         $bds->delivery_id = $delivery_id;
         $bds->merchant_trans_id = $merchant_trans_id;
         $bds->fulfillment_code = $fulfillment_code;
         $bds->box_id = $i + 1;
         $bds->timestamp = date('Y-m-d H:i:s', time());
         $bds->save();
     }
 }
开发者ID:awidarto,项目名称:jexadmin,代码行数:19,代码来源:Prefs.php


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