From 36b32cbf314df2db95b9b6944a81eb2df61794d5 Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Thu, 7 Sep 2023 19:01:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=A4=A9=E6=95=B0=E8=AE=B0=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/task/TaskLogic.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php index eaa9ab81c..acbb1771b 100644 --- a/app/common/logic/task/TaskLogic.php +++ b/app/common/logic/task/TaskLogic.php @@ -74,8 +74,7 @@ class TaskLogic extends BaseLogic public static function CronAdd(array $v, $datas): bool { try { - TaskTemplate::where('id', $v['id'])->inc('information_day_count', 5)->update(); - return true; + $v['day_count']=$v['day_count']+1; if ($v['types'] == 3) { return true; // $task = Task::where('template_id', $v['id'])->find(); From 849119e15cf6c006fa268f1edb69233fc01396b8 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 8 Sep 2023 10:25:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/RemoteController.php | 15 +++++---------- app/api/controller/TaskController.php | 17 +++++++++-------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/app/api/controller/RemoteController.php b/app/api/controller/RemoteController.php index d2b147962..cb3e5f9f3 100644 --- a/app/api/controller/RemoteController.php +++ b/app/api/controller/RemoteController.php @@ -12,17 +12,12 @@ class RemoteController extends BaseApiController public array $notNeedLogin = ['index']; - public function shang_date_total_price($company,$isDay=1,$arr=[],$template_id=0) + public function shang_date_total_price($company,$arr=[],$template_id=0) { - if($isDay==1){ - $start_time = date('Y-m-d'); - $time=strtotime($start_time)+86399; - $end_time=date('Y-m-d H:i:s',$time); - }else{ - $start_time = date('Y-m-d',strtotime('-1 day', time())); - $time=strtotime($start_time)+86399; - $end_time=date('Y-m-d H:i:s',$time); - } + $start_time = date('Y-m-d'); + $time=strtotime($start_time)+86399; + $end_time=date('Y-m-d H:i:s',$time); + if(isset($arr['start_time']) && $arr['end_time']){ $start_time = $arr['start_time']; $end_time = $arr['end_time']; diff --git a/app/api/controller/TaskController.php b/app/api/controller/TaskController.php index c962d1b28..dc0a9ecf0 100644 --- a/app/api/controller/TaskController.php +++ b/app/api/controller/TaskController.php @@ -45,7 +45,6 @@ class TaskController extends BaseApiController $param['end_time']=date('Y-m-d H:i:s',$end); $where[] = ['start_time', 'between', [$time, $end]]; } - } if (isset($param['status']) && $param['status'] > 0) { $where[] = ['status', '=', $param['status']]; @@ -58,15 +57,17 @@ class TaskController extends BaseApiController foreach ($res as $k => $item) { if ($item['type'] == 33) { $company = Company::where('id', $item['company_id'])->field('id,deposit,company_money,user_id,day_count,company_type,province,city,area,street,village,brigade,responsible_area')->find(); // 可能要判断预存金是否满足 - $find = App(RemoteController::class)->shang_date_total_price($company,1,$param,$item['template_id']); + $find = App(RemoteController::class)->shang_date_total_price($company,$param,$item['template_id']); if ($find != false) { - $transaction_pool=TaskTemplate::where('id',$item['template_id'])->value('transaction_pool'); - if($transaction_pool==0){ - $find['transaction_pool']=0; - }else{ - $find['transaction_pool']=$transaction_pool; + if($timevalue('transaction_pool'); + if($transaction_pool==0){ + $find['transaction_pool']=0; + }else{ + $find['transaction_pool']=$transaction_pool; + } + $res[$k]['extend']['transaction'] = $find; } - $res[$k]['extend']['transaction'] = $find; // Task::where('id',$item['id'])->update(['extend'=>json_encode(['transaction'=>$find],true)]); } else { $res[$k]['extend']['transaction'] = ''; From 92bf30831f79955b6e98913135aabb5ca4a88499 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 8 Sep 2023 18:29:04 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/AccountLogLists.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/api/lists/AccountLogLists.php b/app/api/lists/AccountLogLists.php index 79d38df8c..bb83cd223 100755 --- a/app/api/lists/AccountLogLists.php +++ b/app/api/lists/AccountLogLists.php @@ -16,14 +16,16 @@ namespace app\api\lists; use app\common\enum\user\AccountLogEnum; use app\common\model\user\UserAccountLog; - +use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\Sum; +use app\common\lists\ListsExtendInterface; +use app\common\lists\ListsSearchInterface; /** * 账户流水列表 * Class AccountLogLists * @package app\shopapi\lists */ -class AccountLogLists extends BaseApiDataLists +class AccountLogLists extends BaseApiDataLists implements ListsExtendInterface { /** @@ -79,16 +81,20 @@ class AccountLogLists extends BaseApiDataLists ->limit($this->limitOffset, $this->limitLength) ->select() ->toArray(); - foreach ($lists as &$item) { $item['type_desc'] = AccountLogEnum::getChangeTypeDesc($item['change_type']); $symbol = $item['action'] == AccountLogEnum::DEC ? '-' : '+'; $item['change_amount_desc'] = $symbol . $item['change_amount']; } - return $lists; } + public function extend(){ + $deposit=UserAccountLog::where($this->queryWhere())->where('change_type',203)->sum('change_amount'); + $user_money=UserAccountLog::where($this->queryWhere())->where('change_type',202)->sum('change_amount'); + return ['deposit'=>$deposit,'user_money'=>$user_money]; + + } /** * @notes 获取数量