|
|
@@ -494,14 +494,14 @@ class PayorderBusiness
|
|
|
if ($cardlist->ranking > $goodsData->ranking) {
|
|
|
Db::table('wa_user_social_cark')->where('id', $cardlist->id)->decrement('ranking', $goodsData->ranking);
|
|
|
Db::table('wa_my_goods')->where('id', $myGoodsId)->update([
|
|
|
- 'ranking' => $goodsData->ranking,
|
|
|
+ 'ranking' => $goodsData->ranking,
|
|
|
]);
|
|
|
$new_ranking = bcsub($cardlist->ranking, $goodsData->ranking);
|
|
|
- Db::table('wa_users')->where('id', $data['user_id'])->increment('increase_ranking',$goodsData->ranking);
|
|
|
- }else{
|
|
|
+ Db::table('wa_users')->where('id', $data['user_id'])->increment('increase_ranking', $goodsData->ranking);
|
|
|
+ } else {
|
|
|
$new_ranking = $cardlist->ranking;
|
|
|
}
|
|
|
- Db::table('wa_users')->where('id', $data['user_id'])->update(['new_ranking'=> $new_ranking]);
|
|
|
+ Db::table('wa_users')->where('id', $data['user_id'])->update(['new_ranking' => $new_ranking]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -516,7 +516,7 @@ class PayorderBusiness
|
|
|
if (!empty($userlist->toppid) && !empty($system->rebate_two)) {
|
|
|
StreamBusiness::addStream($userlist->toppid, bcmul($goodsData->pay_price, bcdiv($system->rebate_two, 100, 2), 2), streamType10, moldType8, moldTypefild8, $data['id']);
|
|
|
}
|
|
|
- }elseif ($goodsData->type == 5) {
|
|
|
+ } elseif ($goodsData->type == 5) {
|
|
|
$futureDay = futureDay($goodsData->day);
|
|
|
|
|
|
$myGoodsId_two = Db::table('wa_my_goods')->insertGetId([
|
|
|
@@ -593,7 +593,7 @@ class PayorderBusiness
|
|
|
if (!empty($goodsData->balance)) {
|
|
|
StreamBusiness::addStream($data['user_id'], $goodsData->balance, streamType43, moldType3, moldTypefild3, $data['id']);
|
|
|
}
|
|
|
- Db::table('wa_users')->where('id', $data['user_id'])->update(['mailing_date'=>strtotime(futureDay($goodsData->mailing_date))]);
|
|
|
+ Db::table('wa_users')->where('id', $data['user_id'])->update(['mailing_date' => strtotime(futureDay($goodsData->mailing_date))]);
|
|
|
/** 分佣 */
|
|
|
$system = Db::table('wa_system')->first();
|
|
|
if (!empty($userlist->pid) && !empty($system->rebate)) {
|
|
|
@@ -605,10 +605,28 @@ class PayorderBusiness
|
|
|
if (!empty($userlist->toppid) && !empty($system->rebate_two)) {
|
|
|
StreamBusiness::addStream($userlist->toppid, bcmul($goodsData->pay_price, bcdiv($system->rebate_two, 100, 2), 2), streamType42, moldType16, moldTypefild16, $data['id']);
|
|
|
}
|
|
|
- }elseif ($goodsData->type == 6) {
|
|
|
+ } elseif ($goodsData->type == 6) {
|
|
|
StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
|
|
|
- }elseif ($goodsData->type == 7) {
|
|
|
+ } elseif ($goodsData->type == 7) {
|
|
|
StreamBusiness::addStream($data['user_id'], $goodsData->pay_price, streamType45, moldType17, moldTypefild17, $data['id']);
|
|
|
+ } elseif ($goodsData->type == 8) {
|
|
|
+ $data = Db::table('wa_withdraw')
|
|
|
+ ->whereIn('type', [17, 10])
|
|
|
+ ->where('user_id', $data['user_id'])
|
|
|
+ ->where('status', 1)
|
|
|
+ ->orderByDesc('id')
|
|
|
+ ->get()->toArray();
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ Db::table('wa_withdraw')->where('id', $v->id)->update(['status' => 3, 'updated_at' => date('Y-m-d H:i:s')]);
|
|
|
+ }
|
|
|
+ $protocol_money = Db::table('wa_withdraw')
|
|
|
+ ->whereIn('type', [17, 10])
|
|
|
+ ->where('user_id', $data['user_id'])
|
|
|
+ ->sum('money');
|
|
|
+
|
|
|
+ Db::table('wa_users')->where('id', $data['user_id'])->update(['is_protocol' => 1, 'protocol_time' => date('Y-m-d H:i:s'), 'protocol_money' => $protocol_money]);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/** 新增消费数据 */
|