Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function findById($id)
 {
     if (!($order = $this->model->find($id))) {
         throw new Exception("A order could not be found with a ID value of [{$id}].");
     }
     return $order;
 }
Пример #2
0
 /**
  * 获取异常信息
  * @param int $code
  * @return string
  */
 private function getMsg($code)
 {
     switch ($code) {
         case 2:
             //上传失败,抛出错误信息
             return $this->error;
         case 1:
             //获取驱动错误
             return $this->uploader->getError();
         case -1:
             return _("Lib load error.");
         case -2:
             return _("Files is empty");
         case -3:
             return _("Root path check error.");
         case -4:
             return _("Save path check error.");
     }
     return _("Unknown");
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function findByOwnerId($id)
 {
     return $this->model->where('owner_id', '=', $id)->get()->all();
 }