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 1178731e8..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,16 +57,18 @@ 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)]); + // Task::where('id',$item['id'])->update(['extend'=>json_encode(['transaction'=>$find],true)]); } else { $res[$k]['extend']['transaction'] = ''; } 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 获取数量 diff --git a/app/common/logic/task/TaskLogic.php b/app/common/logic/task/TaskLogic.php index 5edb7cf13..2bcac52da 100644 --- a/app/common/logic/task/TaskLogic.php +++ b/app/common/logic/task/TaskLogic.php @@ -74,6 +74,7 @@ class TaskLogic extends BaseLogic public static function CronAdd(array $v, $datas): bool { try { + $v['day_count']=$v['day_count']+1; if ($v['types'] == 3) { $task = Task::where('template_id', $v['id'])->find(); if ($task) {