From c107e97c3e682301a0bec1426179d25b2b194fd4 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 17 Aug 2023 15:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/CompanyController.php | 5 +++-- app/api/controller/CeshiController.php | 1 - app/api/controller/InformationController.php | 3 ++- app/common/logic/finance/ShareProfit.php | 9 ++++++--- app/job/TaskInformationJob.php | 1 + 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/adminapi/controller/CompanyController.php b/app/adminapi/controller/CompanyController.php index eb68afffe..b20800b69 100644 --- a/app/adminapi/controller/CompanyController.php +++ b/app/adminapi/controller/CompanyController.php @@ -244,6 +244,9 @@ class CompanyController extends BaseAdminController if ($parmas['key'] == 'city') { $where[] = ['area', '=', 0]; } + if( $parmas['value']==''){ + return $this->fail('参数不能为空'); + } $where[] = [$parmas['key'], '=', $parmas['value']]; switch ($parmas['key']) { case 'city': @@ -259,8 +262,6 @@ class CompanyController extends BaseAdminController $where[] = ['brigade', '=', 0]; break; } - - $res = Company::where($where)->column('responsible_area'); foreach($res as $k=>$v){ $res[$k] = explode(',',$v); diff --git a/app/api/controller/CeshiController.php b/app/api/controller/CeshiController.php index 22e340379..e5029751a 100644 --- a/app/api/controller/CeshiController.php +++ b/app/api/controller/CeshiController.php @@ -16,7 +16,6 @@ class CeshiController extends BaseApiController public function index() { $all=TaskSchedulingPlan::whereDay('start_time')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray(); - halt($all); foreach($all as $k=>$v){ queue(TaskInformationJob::class,$v); } diff --git a/app/api/controller/InformationController.php b/app/api/controller/InformationController.php index 3efb28bd1..17d80d400 100644 --- a/app/api/controller/InformationController.php +++ b/app/api/controller/InformationController.php @@ -99,7 +99,8 @@ class InformationController extends BaseApiController TaskTemplate::where('id',$task['template_id'])->inc('information_count',1)->update(); } - UserInformationg::where('id',$param['id'])->update(['update_time'=>time()]); + UserInformationg::where('id',$param['id'])->update(['update_time'=>time(),'is_update'=>1]); + return $this->success('成功'); } diff --git a/app/common/logic/finance/ShareProfit.php b/app/common/logic/finance/ShareProfit.php index 657977d34..ff5064931 100644 --- a/app/common/logic/finance/ShareProfit.php +++ b/app/common/logic/finance/ShareProfit.php @@ -28,6 +28,7 @@ class ShareProfit $userAll=User::where('company_id',$data['company_id'])->where('admin_id',0)->field('id,user_money')->select(); $yser_all_count=count($userAll); $member_maoney_user=bcdiv($master_maoney_user,$yser_all_count,2); + //负责人 Db::startTrans(); try { @@ -40,15 +41,17 @@ class ShareProfit //成员 foreach ($userAll as $key => $value) { - $company_money+=$member_maoney_user; $arr=[$value['id'], AccountLogEnum::UM_INC_TASK, AccountLogEnum::INC,$member_maoney_user,$data['sn'],$data['msg'].'获得收益'.$member_maoney_user.'元',['company_id'=>$data['company_id'],'proportion'=>$proportion],$data['status']]; $this->member($arr); $arr=[$value['id'], AccountLogEnum::UM_INC_TASKUSER, AccountLogEnum::INC,$member_maoney_user,$data['sn'],$data['msg'].'获得账户余额'.$member_maoney_user.'元',['company_id'=>$data['company_id'],'proportion'=>$proportion],$data['status']]; $this->member($arr); } //公司 - Company::where('id',$data['company_id'])->inc('deposit',$company_money)->inc('company_money',$data['money'])->update(); - TaskSchedulingPlan::where('id',$data['id'])->update(['is_pay'=>1]); + if($data['status']==1){ + Company::where('id',$data['company_id'])->inc('deposit',$master_maoney)->inc('company_money',$master_maoney)->update(); + TaskSchedulingPlan::where('id',$data['id'])->update(['is_pay'=>1]); + } + Db::commit(); return true; } catch (\Exception $e) { diff --git a/app/job/TaskInformationJob.php b/app/job/TaskInformationJob.php index f64acb5a7..7604dac92 100644 --- a/app/job/TaskInformationJob.php +++ b/app/job/TaskInformationJob.php @@ -32,6 +32,7 @@ class TaskInformationJob return false; } $name = '小组队长'; + $arr['status'] = 1; } elseif //交易金额 ($data['template_info']['type'] == 33) {