签约结束

This commit is contained in:
2025-12-05 18:13:37 +08:00
parent f25774338f
commit 140d09f276

View File

@@ -293,20 +293,21 @@ class Sign extends Model
db::rollback();
return ['code' => 0, 'msg' => '网络错误,请重试', 'data' => null];
}
}elseif ($sign_user_type == 1){
}elseif ($sign_user_type == 1) {
//签过 给被签约的人分七天给他
// 数据插入 循环插入7条数据 day 取值是今天开始连续七天 的每一天的值 到天
for ($i = 0; $i < 7; $i++){
$data1[$i] = [
for ($i = 0; $i < 7; $i++) {
$data1 = [
'user_id' => $max_sign_user['sign_user_id'],
'value' => round($shouyizs/7, 4),
'value' => round($shouyizs / 7, 4),
'day' => date('Y-m-d', strtotime("+$i days")), // 从今天开始连续七天的日期
'times' => $i+1,
'times' => $i + 1,
'createtime' => time()
];
// 插入数据库
$result[$i] = db::name('vs_user_sign_task')->insert($data1[$i]);
if(!$result[$i]){
$result = db::name('vs_user_sign_task')->insert($data1);
if (!$result) {
db::rollback();
return ['code' => 0, 'msg' => '网络错误,请重试', 'data' => null];
}