Merge remote-tracking branch 'origin/develop' into lms
正在显示
7 个修改的文件
包含
81 行增加
和
14 行删除
| @@ -47,7 +47,7 @@ class ShareUser extends Command | @@ -47,7 +47,7 @@ class ShareUser extends Command | ||
| 47 | foreach ($ayr_share_list as $k => $v){ | 47 | foreach ($ayr_share_list as $k => $v){ |
| 48 | //查询当前用户是否有未推送的博文 | 48 | //查询当前用户是否有未推送的博文 |
| 49 | $ayr_release = new AyrReleaseModel(); | 49 | $ayr_release = new AyrReleaseModel(); |
| 50 | - $release_info = $ayr_release->read(['idempotency_key'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]); | 50 | + $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]); |
| 51 | //有推文时,直接跳出循环 | 51 | //有推文时,直接跳出循环 |
| 52 | if($release_info !== false){ | 52 | if($release_info !== false){ |
| 53 | continue; | 53 | continue; |
| @@ -114,8 +114,6 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K | @@ -114,8 +114,6 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K | ||
| 114 | */ | 114 | */ |
| 115 | public function post_send_msg($param,$api_key){ | 115 | public function post_send_msg($param,$api_key){ |
| 116 | //平台参数处理 | 116 | //平台参数处理 |
| 117 | -// $this->headers['Accept-Encoding'] = 'gzip'; | ||
| 118 | -// $this->headers['Authorization'] = $this->headers['Authorization'].$api_key; | ||
| 119 | $param['idempotencyKey'] = uniqid().time(); | 117 | $param['idempotencyKey'] = uniqid().time(); |
| 120 | $url = $this->path.'/api/post'; | 118 | $url = $this->path.'/api/post'; |
| 121 | return $this->http_post_ayr($url,$param,$api_key); | 119 | return $this->http_post_ayr($url,$param,$api_key); |
| @@ -3,12 +3,16 @@ | @@ -3,12 +3,16 @@ | ||
| 3 | namespace App\Http\Controllers\Bside; | 3 | namespace App\Http\Controllers\Bside; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | +use App\Helper\AyrShare as AyrShareHelper; | ||
| 6 | use App\Helper\Country; | 7 | use App\Helper\Country; |
| 8 | +use App\Models\AyrShare\AyrRelease as AyrReleaseModel; | ||
| 9 | +use App\Models\AyrShare\AyrShare as AyrShareModel; | ||
| 7 | use App\Models\Project\Project; | 10 | use App\Models\Project\Project; |
| 8 | use App\Models\Project\Project as ProjectModel; | 11 | use App\Models\Project\Project as ProjectModel; |
| 9 | use App\Models\User\ProjectMenu as ProjectMenuModel; | 12 | use App\Models\User\ProjectMenu as ProjectMenuModel; |
| 10 | use App\Models\User\ProjectRole as ProjectRoleModel; | 13 | use App\Models\User\ProjectRole as ProjectRoleModel; |
| 11 | use App\Models\User\User as UserModel; | 14 | use App\Models\User\User as UserModel; |
| 15 | +use Carbon\Carbon; | ||
| 12 | use Illuminate\Http\Request; | 16 | use Illuminate\Http\Request; |
| 13 | use Illuminate\Support\Facades\Cache; | 17 | use Illuminate\Support\Facades\Cache; |
| 14 | 18 | ||
| @@ -116,8 +120,60 @@ class ComController extends BaseController | @@ -116,8 +120,60 @@ class ComController extends BaseController | ||
| 116 | $this->response('success'); | 120 | $this->response('success'); |
| 117 | } | 121 | } |
| 118 | 122 | ||
| 119 | - public function get_country(){ | ||
| 120 | - $country = new Country(); | ||
| 121 | - return $country->set_country(); | ||
| 122 | - } | 123 | + |
| 124 | + /** | ||
| 125 | + * @name : (测试定时任务)检测用户是否无操作记录 | ||
| 126 | + * @author :lyh | ||
| 127 | + * @method :post | ||
| 128 | + * @time :2023/5/12 14:55 | ||
| 129 | + */ | ||
| 130 | +// protected function ceShi(){ | ||
| 131 | +// $this->error = 0; | ||
| 132 | +// //获取所有ayr_share用户 | ||
| 133 | +// $ayr_share_model = new AyrShareModel(); | ||
| 134 | +// $ayr_share_list = $ayr_share_model->list($this->map); | ||
| 135 | +// if(!empty($ayr_share_list)){ | ||
| 136 | +// foreach ($ayr_share_list as $k => $v){ | ||
| 137 | +// //查询当前用户是否有未推送的博文 | ||
| 138 | +// $ayr_release = new AyrReleaseModel(); | ||
| 139 | +// $release_info = $ayr_release->read(['schedule_date'=>['>',date('Y-m-d H:i:s',time())],'share_id'=>$v['id']]); | ||
| 140 | +// //有推文时,直接跳出循环 | ||
| 141 | +// if($release_info !== false){ | ||
| 142 | +// continue; | ||
| 143 | +// } | ||
| 144 | +// //查看用户是否在一周内有发送博客 | ||
| 145 | +// $start_at = Carbon::now()->modify('-7 days')->toDateString(); | ||
| 146 | +// $end_at = Carbon::now()->toDateString(); | ||
| 147 | +// $release_info = $ayr_release->read(['created_at'=>['between',[$start_at,$end_at]]]); | ||
| 148 | +// //有发送博文,则跳出循环 | ||
| 149 | +// if($release_info == false){ | ||
| 150 | +// continue; | ||
| 151 | +// } | ||
| 152 | +// //删除用户第三方配置 | ||
| 153 | +// $ayr_share_helper = new AyrShareHelper(); | ||
| 154 | +// $data_profiles = [ | ||
| 155 | +// 'title'=>$v['title'], | ||
| 156 | +// 'profileKey'=>$v['profile_key'] | ||
| 157 | +// ]; | ||
| 158 | +// $res = $ayr_share_helper->deleted_profiles($data_profiles); | ||
| 159 | +// if($res['status'] == 'fail'){ | ||
| 160 | +// $this->error++; | ||
| 161 | +// continue; | ||
| 162 | +// } | ||
| 163 | +// //更新数据库 | ||
| 164 | +// $data = [ | ||
| 165 | +// 'title'=>null, | ||
| 166 | +// 'bind_plat_from'=>null, | ||
| 167 | +// 'profile_key'=>null, | ||
| 168 | +// 'ref_id'=>null, | ||
| 169 | +// ]; | ||
| 170 | +// $res = $ayr_share_model->edit($data,['id'=>$v['id']]); | ||
| 171 | +// if($res == false){ | ||
| 172 | +// $this->error++; | ||
| 173 | +// } | ||
| 174 | +// } | ||
| 175 | +// } | ||
| 176 | +// return $this->error; | ||
| 177 | +// } | ||
| 178 | + | ||
| 123 | } | 179 | } |
| @@ -5,13 +5,21 @@ namespace App\Http\Controllers\Bside\User; | @@ -5,13 +5,21 @@ namespace App\Http\Controllers\Bside\User; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Controllers\Bside\BaseController; | 6 | use App\Http\Controllers\Bside\BaseController; |
| 7 | use App\Http\Logic\Bside\User\DeptUserLogic; | 7 | use App\Http\Logic\Bside\User\DeptUserLogic; |
| 8 | -use App\Http\Logic\Bside\User\UserLogic; | ||
| 9 | -use App\Models\User\DeptUser; | ||
| 10 | use App\Models\User\ViewDeptUser; | 8 | use App\Models\User\ViewDeptUser; |
| 11 | 9 | ||
| 12 | class DeptUserController extends BaseController | 10 | class DeptUserController extends BaseController |
| 13 | { | 11 | { |
| 14 | - | 12 | + /** |
| 13 | + * @name :name | ||
| 14 | + * @return void | ||
| 15 | + * @author :liyuhang | ||
| 16 | + * @method | ||
| 17 | + */ | ||
| 18 | + public function lists(ViewDeptUser $viewDeptUser){ | ||
| 19 | + $this->map['project_id'] = $this->user['project_id']; | ||
| 20 | + $lists = $viewDeptUser->lists($this->map,$this->page,$this->row,'user_id'); | ||
| 21 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 22 | + } | ||
| 15 | /** | 23 | /** |
| 16 | * @param ViewDeptUser $viewDeptUser | 24 | * @param ViewDeptUser $viewDeptUser |
| 17 | * @name :(详情)info | 25 | * @name :(详情)info |
| @@ -21,9 +21,13 @@ class UserController extends BaseController | @@ -21,9 +21,13 @@ class UserController extends BaseController | ||
| 21 | * @author :liyuhang | 21 | * @author :liyuhang |
| 22 | * @method | 22 | * @method |
| 23 | */ | 23 | */ |
| 24 | - public function lists(ViewDeptUser $viewDeptUser){ | 24 | + public function lists(UserModel $userModel){ |
| 25 | + //TODO::搜索参数统一处理 | ||
| 25 | $this->map['project_id'] = $this->user['project_id']; | 26 | $this->map['project_id'] = $this->user['project_id']; |
| 26 | - $lists = $viewDeptUser->lists($this->map,$this->page,$this->row,'user_id'); | 27 | + $lists = $userModel->lists($this->map,$this->page,$this->row,$this->order,['id','name','mobile','created_at','wechat','status']); |
| 28 | + if(empty($lists)){ | ||
| 29 | + $this->response('error',Code::USER_ERROR,[]); | ||
| 30 | + } | ||
| 27 | $this->response('success',Code::SUCCESS,$lists); | 31 | $this->response('success',Code::SUCCESS,$lists); |
| 28 | } | 32 | } |
| 29 | 33 |
| @@ -84,7 +84,7 @@ class Base extends Model | @@ -84,7 +84,7 @@ class Base extends Model | ||
| 84 | * @author :liyuhang | 84 | * @author :liyuhang |
| 85 | * @method | 85 | * @method |
| 86 | */ | 86 | */ |
| 87 | - public function list($map,$order = 'sort',$fields = ['*']): array | 87 | + public function list($map = [],$order = 'id',$fields = ['*']): array |
| 88 | { | 88 | { |
| 89 | $query = $this->formatQuery($map); | 89 | $query = $this->formatQuery($map); |
| 90 | $lists = $query->select($fields)->orderBy($order)->get(); | 90 | $lists = $query->select($fields)->orderBy($order)->get(); |
| @@ -176,6 +176,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -176,6 +176,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 176 | //成员管理 | 176 | //成员管理 |
| 177 | //组织架构 | 177 | //组织架构 |
| 178 | Route::prefix('user')->group(function () { | 178 | Route::prefix('user')->group(function () { |
| 179 | + Route::any('/', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'lists'])->name('dept_user'); | ||
| 179 | Route::any('/save', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'save'])->name('dept_user_add'); | 180 | Route::any('/save', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'save'])->name('dept_user_add'); |
| 180 | Route::any('/info', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'info'])->name('dept_user_info'); | 181 | Route::any('/info', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'info'])->name('dept_user_info'); |
| 181 | Route::any('/set_admin', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'set_admin'])->name('dept_user_set_admin'); | 182 | Route::any('/set_admin', [\App\Http\Controllers\Bside\User\DeptUserController::class, 'set_admin'])->name('dept_user_set_admin'); |
| @@ -266,7 +267,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -266,7 +267,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 266 | //无需登录验证的路由组 | 267 | //无需登录验证的路由组 |
| 267 | Route::group([], function () { | 268 | Route::group([], function () { |
| 268 | Route::any('/login', [\App\Http\Controllers\Bside\ComController::class, 'login'])->name('login'); | 269 | Route::any('/login', [\App\Http\Controllers\Bside\ComController::class, 'login'])->name('login'); |
| 269 | -// Route::any('/', [\App\Http\Controllers\Bside\ComController::class, 'get_country'])->name('get_country'); | 270 | + Route::any('/', [\App\Http\Controllers\Bside\ComController::class, 'ceShi'])->name('ce_shi'); |
| 270 | Route::get('/file/download', [\App\Http\Controllers\Bside\FileController::class, 'download'])->name('file_download'); | 271 | Route::get('/file/download', [\App\Http\Controllers\Bside\FileController::class, 'download'])->name('file_download'); |
| 271 | Route::any('/image/{hash}/{w?}/{h?}', [\App\Http\Controllers\File\ImageController::class,'index'])->name('image_show'); | 272 | Route::any('/image/{hash}/{w?}/{h?}', [\App\Http\Controllers\File\ImageController::class,'index'])->name('image_show'); |
| 272 | Route::any('/file_hash/{hash}', [\App\Http\Controllers\File\FileController::class,'index'])->name('file_show'); | 273 | Route::any('/file_hash/{hash}', [\App\Http\Controllers\File\FileController::class,'index'])->name('file_show'); |
-
请 注册 或 登录 后发表评论