Commit be12296a by 杨昕

code format

parent 57de4232
Pipeline #9914 passed with stages
in 32 seconds
......@@ -44,7 +44,13 @@ class MediaCategoryModel extends Eloquent
*/
public static function catgListPage($request){
try{
$catgList = MediaCategoryModel::paginate(10);
$where = [];
if ($request->name){
$where['name'] = $request->name;
}
$catgList = MediaCategoryModel::where($where)->paginate(10);
}catch (\Exception $exception){
throw new DatabaseException("类别不存在");
......
......@@ -24,23 +24,6 @@ class UserModel extends Eloquent
public static function getUserList($request){
try{
// $str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
//
// for ($i = 0;$i<50;$i++){
//
// $data = [
// 'name' => substr(str_shuffle($str),5,10),
// 'create_time' => date('Y-m-d H:i:s',time()),
// 'status' => 0,
// 'password' => md5(123456)
// ];
//
// DB::connection("mongodb")->collection("users")->insertGetId($data);
//
// }
// die;
$where = [];
if ($request->name){
......
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