Commit fe8bb9ca by 杨昕

code format

parent 598c1633
......@@ -35,7 +35,7 @@ class UsersController extends Controller
if (preg_match("['|\"|\/|\\\|\.|:]", $request->uuid)) {
throw new ControllerException(400, 'uuid含有非法字符');
throw new ControllerException('uuid含有非法字符',400);
}
$password = strtolower($request->password);
$username = $request->username;
......
......@@ -11,6 +11,10 @@ class MediaCategoryModel extends Eloquent
{
protected $collection = "media_category";
protected $connection = 'mongodb'; //使用mongodb
protected $primaryKey = '_id';
/**
* 查询媒资列表
* @param $request
......@@ -21,14 +25,7 @@ class MediaCategoryModel extends Eloquent
try{
$catgList = DB::connection("mongodb")->collection(self::$collection)->get()->toArray();
foreach ($catgList as &$catg){
$idArr = ($catg['_id'])->jsonSerialize();
$catg['_id'] = $catg['_id'] = $idArr['$oid'];
}
$catgList = MediaCategoryModel::get()->toArray();
}catch (\Exception $exception){
throw new DatabaseException("组织不存在");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment