更新事件
This commit is contained in:
parent
874638a73c
commit
20557acb98
@ -42,15 +42,15 @@ class CeshiController extends BaseApiController
|
|||||||
|
|
||||||
// TaskTemplate::where('id',109)->update(['transaction_pool'=>bcadd($transaction_pool,$day_money,2)]);
|
// TaskTemplate::where('id',109)->update(['transaction_pool'=>bcadd($transaction_pool,$day_money,2)]);
|
||||||
// }
|
// }
|
||||||
// $all=TaskSchedulingPlan::where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
|
$all=TaskSchedulingPlan::where('id',893)->with(['template_info','scheduling'])->select()->toArray();
|
||||||
// foreach($all as $k=>$v){
|
foreach($all as $k=>$v){
|
||||||
// queue(TaskInformationJob::class,$v);
|
queue(TaskInformationJob::class,$v);
|
||||||
// }
|
}
|
||||||
// return true;
|
return true;
|
||||||
$plan_all = TaskScheduling::where('id',99)->with('company_info')->select()->toArray();
|
$plan_all = TaskScheduling::where('id',119)->with('company_info')->select()->toArray();
|
||||||
$plan_ids = [];
|
$plan_ids = [];
|
||||||
foreach ($plan_all as $k => $v) {
|
foreach ($plan_all as $k => $v) {
|
||||||
$all = TaskTemplate::where('id', 109)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray();
|
$all = TaskTemplate::where('id', 118)->where('task_scheduling', $v['id'])->limit(30)->select()->toArray();
|
||||||
$plan_ids[] = $v['id'];
|
$plan_ids[] = $v['id'];
|
||||||
if ($all) {
|
if ($all) {
|
||||||
$plan_all[$k]['template'] = $all;
|
$plan_all[$k]['template'] = $all;
|
||||||
|
@ -10,6 +10,7 @@ use think\facade\Log;
|
|||||||
use app\common\model\Company;
|
use app\common\model\Company;
|
||||||
use app\common\model\task_scheduling_plan\TaskSchedulingPlan;
|
use app\common\model\task_scheduling_plan\TaskSchedulingPlan;
|
||||||
use app\common\model\task_template\TaskTemplate;
|
use app\common\model\task_template\TaskTemplate;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务结算执行的具体逻辑
|
* 任务结算执行的具体逻辑
|
||||||
@ -22,6 +23,7 @@ class TaskInformationJob
|
|||||||
// if ($job->attempts() > 1) {
|
// if ($job->attempts() > 1) {
|
||||||
// //通过这个方法可以检查这个任务已经重试了几次了
|
// //通过这个方法可以检查这个任务已经重试了几次了
|
||||||
// }
|
// }
|
||||||
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
TaskSchedulingPlan::where('id', $data['id'])->update(['is_pay' => 1]);
|
TaskSchedulingPlan::where('id', $data['id'])->update(['is_pay' => 1]);
|
||||||
$company = Company::where('id', $data['company_id'])->field('id,deposit,responsible_area,company_money,shareholder_money,user_id,day_count,company_type,province,city,area,street,village,brigade')->find(); // 可能要判断预存金是否满足
|
$company = Company::where('id', $data['company_id'])->field('id,deposit,responsible_area,company_money,shareholder_money,user_id,day_count,company_type,province,city,area,street,village,brigade')->find(); // 可能要判断预存金是否满足
|
||||||
@ -42,7 +44,7 @@ class TaskInformationJob
|
|||||||
} elseif
|
} elseif
|
||||||
//交易金额
|
//交易金额
|
||||||
($data['template_info']['type'] == 33) {
|
($data['template_info']['type'] == 33) {
|
||||||
$shang_date_total_price = App(RemoteController::class)->shang_date_total_price($company,2);
|
$shang_date_total_price = App(RemoteController::class)->shang_date_total_price($company);
|
||||||
if ($shang_date_total_price == false) {
|
if ($shang_date_total_price == false) {
|
||||||
Log::info('交易金额任务,交易金额未达到要求:' . json_encode($data));
|
Log::info('交易金额任务,交易金额未达到要求:' . json_encode($data));
|
||||||
Task::where('id', $data['task_id'])->update(['status' => 5]);
|
Task::where('id', $data['task_id'])->update(['status' => 5]);
|
||||||
@ -129,7 +131,9 @@ class TaskInformationJob
|
|||||||
// $arr['proportion_two'] = $data['template_info']['proportion_two'];
|
// $arr['proportion_two'] = $data['template_info']['proportion_two'];
|
||||||
$arr['sn'] = $data['sn'];
|
$arr['sn'] = $data['sn'];
|
||||||
$arr['id'] = $data['id'];
|
$arr['id'] = $data['id'];
|
||||||
|
Db::commit();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
Db::rollback();
|
||||||
Log::error('line:'.$e->getLine().'异常报错:任务结算失败:' . $data['template_info']['title'] . $e->getMessage() . json_encode($data));
|
Log::error('line:'.$e->getLine().'异常报错:任务结算失败:' . $data['template_info']['title'] . $e->getMessage() . json_encode($data));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user