Commit 598c1633 by 杨昕

test

parent 17af9925
......@@ -23,14 +23,14 @@ class UsersController extends Controller
if (!$request->password) {
throw new ControllerException(400, '口令不能为空');
throw new ControllerException('口令不能为空',400);
}
if ($request->filled('username')) {
if (mb_strlen($request->username)>=20) {
$request->username = mb_substr($request->username,0,20,"UTF-8").'...';
}
} else {
throw new ControllerException(400, '昵称必须填写');
throw new ControllerException('昵称必须填写',400);
}
......
......@@ -5,10 +5,11 @@ namespace App\Model;
use App\Exceptions\DatabaseException;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
class MediaCategoryModel extends Model
class MediaCategoryModel extends Eloquent
{
protected static $collection = "media_category";
protected $collection = "media_category";
/**
* 查询媒资列表
......
......@@ -66,6 +66,15 @@ class MediaModel extends Eloquent
$media_info = explode("&",$request->media_name);
$mediaCatg = MediaCategoryModel::where('name',$request->media_type)->first();
var_dump($mediaCatg);die;
MediaCategoryModel::addMediaCatg($request->all());
$data = [
'_id' => $media_id,
......
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