1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Mead
- * Date: 2019/9/4
- * Time: 9:36 AM
- */
- namespace App\Models;
- trait LocationLosTraitModel
- {
- // private static $time_find_order_tagss = 'time_find_order:';
- public function byTimeGetOrder($time, $box_no)
- {
- $where['box_no'] = $box_no;
- $where['box_time'] = ['$lt' => $time];
- $options['sort'] = ['created_at' => -1];
- $options['limit'] = 5;
- $logs = $this->mongo->location_logs->find($where, $options);
- $log = false;
- foreach ($logs as $item) {
- if ($item['order_id']) {
- $log = $item;
- break;
- }
- }
- return $log;
- }
- }
|