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