|
|
@@ -481,20 +481,25 @@ class PayorderBusiness
|
|
|
}
|
|
|
if (!empty($goodsData->balance)) {
|
|
|
StreamBusiness::addStream($data['user_id'], $goodsData->balance, streamType36, moldType13, moldTypefild13, $data['id']);
|
|
|
- Db::table('wa_users')->where('id', $data['user_id'])->increment('accumulate_thirteen',$goodsData->balance);
|
|
|
+ Db::table('wa_users')->where('id', $data['user_id'])->increment('accumulate_thirteen', $goodsData->balance);
|
|
|
}
|
|
|
if (!empty($goodsData->usd_quota)) {
|
|
|
StreamBusiness::addStream($data['user_id'], $goodsData->usd_quota, streamType36, moldType14, moldTypefild14, $data['id']);
|
|
|
- Db::table('wa_users')->where('id', $data['user_id'])->increment('accumulate_fourteen',$goodsData->usd_quota);
|
|
|
+ Db::table('wa_users')->where('id', $data['user_id'])->increment('accumulate_fourteen', $goodsData->usd_quota);
|
|
|
}
|
|
|
|
|
|
- if(!empty($goodsData->ranking)){
|
|
|
- $cardlist = Db::table('wa_user_social_cark')->where('user_id', $data['user_id'])->first();
|
|
|
- if(!empty($cardlist)){
|
|
|
- if($cardlist->ranking>$goodsData->ranking){
|
|
|
- Db::table('wa_user_social_cark')->where('id', $cardlist->id)->decrement('ranking',$goodsData->ranking);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!empty($goodsData->ranking)) {
|
|
|
+ $cardlist = Db::table('wa_user_social_cark')->where('user_id', $data['user_id'])->first();
|
|
|
+ if (!empty($cardlist)) {
|
|
|
+ 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,
|
|
|
+ 'old_ranking' => $cardlist->ranking,
|
|
|
+ 'new_ranking' => bcadd($cardlist->ranking, $goodsData->ranking),
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 分佣 */
|