Beispiel #1
0
 public function orders()
 {
     $orders_create = OrderProductModel::all();
     $orders_all = OrderModel::all();
     $orders_firm = OrderFirmModel::all();
     //各个订单
     $orders_C = OrderProductModel::where('isshow', 1)->paginate($this->limit);
     $orders_A = OrderModel::where('del', 0)->where('isshow', 1)->paginate($this->limit);
     $orders_F = OrderFirmModel::where('del', 0)->where('isshow', 1)->paginate($this->limit);
     return array('create' => count($orders_create), 'all' => count($orders_all), 'firm' => count($orders_firm), 'ordersC' => $orders_C, 'ordersA' => $orders_A, 'ordersF' => $orders_F);
 }
 public function query($del, $isshow)
 {
     if ($del == '') {
         $del = [0, 1];
     }
     if ($isshow == '') {
         $isshow = [0, 1];
     }
     if (is_array($del)) {
         if (is_array($isshow)) {
             $datas = OrderFirmModel::orderBy('id', 'desc')->paginate($this->limit);
         } else {
             $datas = OrderFirmModel::where('isshow', $isshow)->orderBy('id', 'desc')->paginate($this->limit);
         }
     } else {
         if (is_array($isshow)) {
             $datas = OrderFirmModel::where('del', $del)->orderBy('id', 'desc')->paginate($this->limit);
         } else {
             $datas = OrderFirmModel::where('del', $del)->where('isshow', $isshow)->orderBy('id', 'desc')->paginate($this->limit);
         }
     }
     $datas->limit = $this->limit;
     return $datas;
 }
 public function query()
 {
     $datas = OrderFirmModel::where('del', 0)->where('isshow', 1)->orderBy('id', 'desc')->paginate($this->limit);
     $datas->limit = $this->limit;
     return $datas;
 }