|
|
@@ -283,23 +283,13 @@ class Education
|
|
|
}
|
|
|
// 合约时间到期自动解约
|
|
|
public function ContractTemplatEnd(){
|
|
|
- try {
|
|
|
- $lst = (new UserContractRecordModel())->where("status",1)->where("end_time","<",time())->select();
|
|
|
- $sql = (new UserContractRecordModel())->getLastSql();
|
|
|
- @file_put_contents('quanju.txt', $sql . "-sql语句\r\n", 8);
|
|
|
- if(!empty($lst)){
|
|
|
- $lst = $lst->toArray();
|
|
|
- @file_put_contents('quanju.txt', '搜索条件:' . json_encode($lst, JSON_UNESCAPED_UNICODE));
|
|
|
- }
|
|
|
- @file_put_contents('quanju.txt', json_encode($lst) . "-到期合约列表\r\n", 8);
|
|
|
-
|
|
|
- (new UserContractRecordModel())->where("status",1)->where("end_time","<",time())->update(["status"=>2]);
|
|
|
- return app('json')->success('修改完成');
|
|
|
- } catch (\Exception $e) {
|
|
|
- $errorMsg = date('Y-m-d H:i:s') . ' 错误: ' . $e->getMessage() . "\r\n";
|
|
|
- @file_put_contents('quanju.txt', $errorMsg, FILE_APPEND);
|
|
|
- return app('json')->fail('操作失败: ' . $e->getMessage());
|
|
|
+ $lst = (new UserContractRecordModel())->where("status",1)->where("end_time","<",time())->select();
|
|
|
+ if(!empty($lst)){
|
|
|
+ $lst = $lst->toArray();
|
|
|
+ Log::info('搜索条件:' . json_encode($lst, JSON_UNESCAPED_UNICODE));
|
|
|
}
|
|
|
+ (new UserContractRecordModel())->where("status",1)->where("end_time","<",time())->update(["status"=>2]);
|
|
|
+ return app('json')->success('修改完成');
|
|
|
}
|
|
|
|
|
|
|