|
|
@@ -3190,15 +3190,16 @@ class StoreOrderRepository extends BaseRepository
|
|
3190
|
3190
|
|
|
3191
|
3191
|
|
|
3192
|
3192
|
// 添加推荐奖励
|
|
3193
|
|
-
|
|
|
3193
|
+ log::info("推荐佣金kaishi");
|
|
3194
|
3194
|
//推荐养老金添加
|
|
3195
|
3195
|
$pvfee=round($order['total_price']*$sanfangfenpei['pv'] ,2);
|
|
3196
|
|
- $sprerdUser= Db::name("user")->where('spread_id',$order["uid"])->find();
|
|
|
3196
|
+ $zijiUser=Db::name("user")->where('uid',$order["uid"])->find();
|
|
|
3197
|
+ $sprerdUser= Db::name("user")->where('uid',$zijiUser['spread_uid'])->find();
|
|
3197
|
3198
|
//不为空的时候进行添加推荐奖励
|
|
3198
|
3199
|
if($sprerdUser){
|
|
3199
|
3200
|
//奖励推荐用户养老金
|
|
3200
|
3201
|
//判断用户是身份,业务员以进行奖励
|
|
3201
|
|
-
|
|
|
3202
|
+ log::info("推荐佣金");
|
|
3202
|
3203
|
if($sprerdUser["user_group"]>1){
|
|
3203
|
3204
|
//奖励推荐者养老金
|
|
3204
|
3205
|
//养老金比例是pv佣金的5%
|
|
|
@@ -3220,6 +3221,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3220
|
3221
|
|
|
3221
|
3222
|
//奖励推广佣金添加
|
|
3222
|
3223
|
$yongjinbili=0;//奖励佣金比例
|
|
|
3224
|
+ log::info("推荐人信息");
|
|
3223
|
3225
|
//普通用户
|
|
3224
|
3226
|
if($sprerdUser["user_group"]==1){
|
|
3225
|
3227
|
$yongjinbili=5;
|
|
|
@@ -3252,13 +3254,13 @@ class StoreOrderRepository extends BaseRepository
|
|
3252
|
3254
|
$tuiguanyongjin=round($pvfee*$yongjinbili/100,2);
|
|
3253
|
3255
|
|
|
3254
|
3256
|
|
|
3255
|
|
- $tuiYongmark = "推荐消费获得佣金".$tuiguanyanglaojin;
|
|
|
3257
|
+ $tuiYongmark = "推荐消费获得佣金".$tuiguanyongjin;
|
|
3256
|
3258
|
|
|
3257
|
3259
|
//end会费
|
|
3258
|
3260
|
//sat存养老金
|
|
3259
|
3261
|
$tuiYongzhoutitle = "推广佣金 ";
|
|
3260
|
3262
|
$commission_yong_type = 3;
|
|
3261
|
|
- if ($tuiguanyanglaojin >= 0.01) {
|
|
|
3263
|
+ if ($tuiguanyongjin >= 0.01) {
|
|
3262
|
3264
|
$this->add_bill($tuiYongzhoutitle, $tuiguanyongjin, $sprerdUser["uid"], $tuiYongmark, $commission_yong_type, $order_sn, $order_id, $order["mer_id"], 0, 0, $order["type_shop"]);
|
|
3263
|
3265
|
}else {
|
|
3264
|
3266
|
Db::name('log')->insert(['data'=>'订单号:'.$order_sn.'付款额度较低或 商家、平台设置的返佣比例较低,佣金低于0.01无法入库 特此记录!']);
|