|
@@ -88,15 +88,15 @@ class TaskBusiness
|
|
|
StreamBusiness::delStream($usersData->id, $balance, streamType27, moldType3, moldTypefild3, $taskId);
|
|
StreamBusiness::delStream($usersData->id, $balance, streamType27, moldType3, moldTypefild3, $taskId);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }elseif ($cronTask->goods_type == 5) {
|
|
|
|
|
|
|
+ } elseif ($cronTask->goods_type == 5) {
|
|
|
/** @var $usersData 查询会员信息 */
|
|
/** @var $usersData 查询会员信息 */
|
|
|
$usersData = Db::table('wa_users')->where('id', $cronTask->user_id)->first();
|
|
$usersData = Db::table('wa_users')->where('id', $cronTask->user_id)->first();
|
|
|
- if($cronTask->dividend_time<time()){
|
|
|
|
|
|
|
+ if ($cronTask->dividend_time < time()) {
|
|
|
Db::table('wa_cron_task')->where('id', $taskId)->update([
|
|
Db::table('wa_cron_task')->where('id', $taskId)->update([
|
|
|
- 'is_finish' => 2
|
|
|
|
|
|
|
+ 'is_finish' => 2
|
|
|
]);
|
|
]);
|
|
|
StreamBusiness::addStream($usersData->id, $cronTask->money, streamType42, moldType3, moldTypefild3, $taskId);
|
|
StreamBusiness::addStream($usersData->id, $cronTask->money, streamType42, moldType3, moldTypefild3, $taskId);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
/** @var $has 查询今天是否已经发奖 */
|
|
/** @var $has 查询今天是否已经发奖 */
|
|
|
$has = Db::table('wa_stream')
|
|
$has = Db::table('wa_stream')
|
|
|
->where('user_id', $cronTask->user_id)
|
|
->where('user_id', $cronTask->user_id)
|
|
@@ -116,6 +116,36 @@ class TaskBusiness
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ } elseif ($cronTask->goods_type == 17) {
|
|
|
|
|
+ /** @var $usersData 查询会员信息 */
|
|
|
|
|
+ $usersData = Db::table('wa_users')->where('id', $cronTask->user_id)->first();
|
|
|
|
|
+ if ($cronTask->dividend_time < time()) {
|
|
|
|
|
+ Db::table('wa_cron_task')->where('id', $taskId)->update([
|
|
|
|
|
+ 'is_finish' => 2
|
|
|
|
|
+ ]);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ /** @var $has 查询今天是否已经发奖 */
|
|
|
|
|
+ $has = Db::table('wa_stream')
|
|
|
|
|
+ ->where('user_id', $cronTask->user_id)
|
|
|
|
|
+ ->where('type', streamType52)
|
|
|
|
|
+ ->where('mold', moldType24)
|
|
|
|
|
+ ->whereBetween('add_time', [strtotime(date('Y-m-d') . ' 00:00:00'), strtotime(date('Y-m-d') . ' 23:59:59')])
|
|
|
|
|
+ ->where('source_id', $taskId)
|
|
|
|
|
+ ->exists();
|
|
|
|
|
+ if (empty($has) && !empty($usersData)) {
|
|
|
|
|
+ if(!empty($cronTask->bonus)){
|
|
|
|
|
+ if($cronTask->event_time==0){
|
|
|
|
|
+ StreamBusiness::addStream($usersData->id, $cronTask->bonus, streamType52, moldType24, moldTypefild24, $taskId);
|
|
|
|
|
+ }elseif ($cronTask->event_time < time() && $cronTask->event_time > 0){
|
|
|
|
|
+ $goodslist = Db::table('wa_goods')->where('id', $cronTask->goods_id)->first();
|
|
|
|
|
+ StreamBusiness::addStream($usersData->id, $goodslist->bonus, streamType52, moldType24, moldTypefild24, $taskId);
|
|
|
|
|
+ }elseif ($cronTask->event_time > time()){
|
|
|
|
|
+ StreamBusiness::addStream($usersData->id, $cronTask->bonus, streamType52, moldType24, moldTypefild24, $taskId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
Db::table('wa_cron_task')->where('id', $taskId)->update([
|
|
Db::table('wa_cron_task')->where('id', $taskId)->update([
|
|
|
'day_dividend_time' => strtotime(date('Y-m-d', strtotime('+1 days')) . ' 00:10:00'),
|
|
'day_dividend_time' => strtotime(date('Y-m-d', strtotime('+1 days')) . ' 00:10:00'),
|
|
@@ -180,14 +210,14 @@ class TaskBusiness
|
|
|
|
|
|
|
|
if (empty($has) && !empty($usersData)) {
|
|
if (empty($has) && !empty($usersData)) {
|
|
|
$goodslist = Db::table('wa_goods')->where('id', $cronTask->goods_id)->first();
|
|
$goodslist = Db::table('wa_goods')->where('id', $cronTask->goods_id)->first();
|
|
|
- if(!empty($goodslist->bonus)){
|
|
|
|
|
|
|
+ if (!empty($goodslist->bonus)) {
|
|
|
StreamBusiness::addStream($usersData->id, $goodslist->bonus, streamType37, moldType12, moldTypefild12, $taskId);
|
|
StreamBusiness::addStream($usersData->id, $goodslist->bonus, streamType37, moldType12, moldTypefild12, $taskId);
|
|
|
}
|
|
}
|
|
|
- if($usersData->money_thirteen<$usersData->accumulate_thirteen){
|
|
|
|
|
- Db::table('wa_users')->where('id', $usersData->id)->update(['money_thirteen'=>$usersData->accumulate_thirteen]);
|
|
|
|
|
|
|
+ if ($usersData->money_thirteen < $usersData->accumulate_thirteen) {
|
|
|
|
|
+ Db::table('wa_users')->where('id', $usersData->id)->update(['money_thirteen' => $usersData->accumulate_thirteen]);
|
|
|
}
|
|
}
|
|
|
- if($usersData->money_fourteen<$usersData->accumulate_fourteen){
|
|
|
|
|
- Db::table('wa_users')->where('id', $usersData->id)->update(['money_fourteen'=>$usersData->accumulate_fourteen]);
|
|
|
|
|
|
|
+ if ($usersData->money_fourteen < $usersData->accumulate_fourteen) {
|
|
|
|
|
+ Db::table('wa_users')->where('id', $usersData->id)->update(['money_fourteen' => $usersData->accumulate_fourteen]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
Db::table('wa_cron_task_four')->where('id', $taskId)->update([
|
|
Db::table('wa_cron_task_four')->where('id', $taskId)->update([
|