Browse Source

销售业绩

sunhao 5 years ago
parent
commit
438a0b7ef6
1 changed files with 6 additions and 0 deletions
  1. 6 0
      app/Http/Controllers/Admin/StatisticsController.php

+ 6 - 0
app/Http/Controllers/Admin/StatisticsController.php

2384
             $fan_count = DB::table('cust_day_detail')->select(DB::raw('sum(fan_add) as fan_count, admin_name'))->where('dtime', '>=', $m_stime)->where('dtime', '<', $m_etime)->where('admin_id', $v['admin_id'])->where('is_del', 0)->first();
2384
             $fan_count = DB::table('cust_day_detail')->select(DB::raw('sum(fan_add) as fan_count, admin_name'))->where('dtime', '>=', $m_stime)->where('dtime', '<', $m_etime)->where('admin_id', $v['admin_id'])->where('is_del', 0)->first();
2385
             $v['fan_count'] = $fan_count->fan_count;
2385
             $v['fan_count'] = $fan_count->fan_count;
2386
             $v['admin_name'] = $fan_count->admin_name;
2386
             $v['admin_name'] = $fan_count->admin_name;
2387
+            if(empty($v['admin_name'])){
2388
+                $v['admin_name'] = DB::table('admin')->where('id', $v['admin_id'])->pluck('name');
2389
+            }
2387
             #计算提成
2390
             #计算提成
2388
             $v['bonus'] = $this->getSalerBonus($v['order_amount']);
2391
             $v['bonus'] = $this->getSalerBonus($v['order_amount']);
2389
         }
2392
         }
2469
             $fan_count = DB::table('cust_day_detail')->select(DB::raw('sum(fan_add) as fan_count, admin_name'))->where('dtime', '>=', $m_stime)->where('dtime', '<', $m_etime)->where('admin_id', $v['admin_id'])->where('is_del', 0)->first();
2472
             $fan_count = DB::table('cust_day_detail')->select(DB::raw('sum(fan_add) as fan_count, admin_name'))->where('dtime', '>=', $m_stime)->where('dtime', '<', $m_etime)->where('admin_id', $v['admin_id'])->where('is_del', 0)->first();
2470
             $v['fan_count'] = $fan_count->fan_count;
2473
             $v['fan_count'] = $fan_count->fan_count;
2471
             $v['admin_name'] = $fan_count->admin_name;
2474
             $v['admin_name'] = $fan_count->admin_name;
2475
+            if(empty($v['admin_name'])){
2476
+                $v['admin_name'] = DB::table('admin')->where('id', $v['admin_id'])->pluck('name');
2477
+            }
2472
             #计算提成
2478
             #计算提成
2473
             $bonus = $this->getSalerBonus($v['order_amount']);
2479
             $bonus = $this->getSalerBonus($v['order_amount']);
2474
             $v['bonus0'] = $bonus[0];
2480
             $v['bonus0'] = $bonus[0];