| xqd
@@ -0,0 +1,52 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+
|
|
|
+namespace App\Http\Controllers\Api;
|
|
|
+
|
|
|
+
|
|
|
+use App\Models\User;
|
|
|
+use App\Models\UserInfoModel;
|
|
|
+
|
|
|
+class TestController
|
|
|
+{
|
|
|
+ public function creat_user(){
|
|
|
+ $total = 1000;
|
|
|
+
|
|
|
+ for ($i=0;$i<$total;$i++){
|
|
|
+ $ins = array();
|
|
|
+ $ins['mobile'] = '199'.rand(10000000,99999999);
|
|
|
+ $ins['password'] = '123456';
|
|
|
+ $ins['pid'] = 0;
|
|
|
+ $ins['sex'] = rand(1,2);
|
|
|
+ $ins['is_vip'] = rand(0,1);
|
|
|
+ $ins['is_auth'] = 1;
|
|
|
+ $ins['ycode'] = create_invite_code();
|
|
|
+ $ins['latitude'] = '30.'.rand(100000,999999);//30.720653
|
|
|
+ $ins['longitude'] = '103.'.rand(100000,999999);//103.720653
|
|
|
+ $ins['online'] = rand(0,1);
|
|
|
+ $ins['notice_status'] = 1;
|
|
|
+ $user = User::query()->firstOrCreate($ins);
|
|
|
+ $ins_info = array();
|
|
|
+ $ins_info['user_id'] = $user->id;
|
|
|
+ $ins_info['avatar'] = 'https://zhengda.oss-accelerate.aliyuncs.com/chengluApp/image_picker977203985037292577.jpg';
|
|
|
+ $ins_info['nickname'] = '用户'.$user->id;
|
|
|
+ $ins_info['birthday'] = rand(1980,2010).'-'.rand(1,12).'-'.rand(1,28);
|
|
|
+ $ins_info['height'] = rand(140,190);
|
|
|
+ $ins_info['weight'] = rand(30,100);
|
|
|
+ $ins_info['work'] = ['学生','老师','程序员','工程师'][rand(0,3)];
|
|
|
+ $ins_info['info'] = '这是个人介绍';
|
|
|
+ $ins_info['area'] = '成都市';
|
|
|
+ $ins_info['area_code'] = '510100';
|
|
|
+ $ins_info['figure'] = '健美';
|
|
|
+ $ins_info['feeling'] = '单身';
|
|
|
+ $ins_info['education'] = '本科';
|
|
|
+ $ins_info['income'] = '10-30W';
|
|
|
+ $ins_info['hobby'] = '火锅,音乐,k歌,蹦迪';
|
|
|
+ $ins_info['drink'] = '饮酒';
|
|
|
+ $ins_info['photo'] = json_encode(['https://zhengda.oss-accelerate.aliyuncs.com/chengluApp/image_picker977203985037292577.jpg','https://zhengda.oss-cn-chengdu.aliyuncs.com/chengluApp/img/%E4%B8%8B%E8%BD%BD.jpg','https://zhengda.oss-cn-chengdu.aliyuncs.com/chengluApp/img/u%3D3564444755%2C3599870531%26fm%3D26%26gp%3D0.jpg']);
|
|
|
+ $ins_info['video'] = json_encode(['https://zhengda.oss-cn-chengdu.aliyuncs.com/chengluApp/a69ce78c4898a7bcf13138bbea71608f.mp4']);
|
|
|
+ UserInfoModel::query()->create($ins_info);
|
|
|
+ }
|
|
|
+ echo 'success';
|
|
|
+ }
|
|
|
+}
|