正在显示
3 个修改的文件
包含
33 行增加
和
1 行删除
@@ -392,8 +392,25 @@ class SalesmanController extends AdminBaseController{ | @@ -392,8 +392,25 @@ class SalesmanController extends AdminBaseController{ | ||
392 | public function set_free_man(){ | 392 | public function set_free_man(){ |
393 | 393 | ||
394 | $id = $_POST['id']; | 394 | $id = $_POST['id']; |
395 | + //删除老师购物车 浏览记录 收藏 订单待付款信息 | ||
396 | + $teacher = Db::name('my_user') -> where('id',$id) -> find(); | ||
397 | + Db::name('shopping_cart') -> where('uid',$teacher['uid']) -> delete(); | ||
398 | + Db::name('browsing_history') -> where('uid',$teacher['uid']) -> delete(); | ||
399 | + Db::name('collect') -> where('uid',$teacher['uid']) -> delete(); | ||
400 | + Db::name('indent') -> where("uid=".$teacher['uid']." and state=4") -> delete(); | ||
401 | + //获取这个老师下的所有学生信息 | ||
402 | + $student = Db::name('my_user') -> where('pid',$id) -> select(); | ||
403 | + //循环删除学生的购物车 浏览记录 收藏 订单待付款信息 | ||
404 | + foreach ($student as $key => $val){ | ||
405 | + Db::name('shopping_cart') -> where('uid',$val['uid']) -> delete(); | ||
406 | + Db::name('browsing_history') -> where('uid',$val['uid']) -> delete(); | ||
407 | + Db::name('collect') -> where('uid',$val['uid']) -> delete(); | ||
408 | + Db::name('indent') -> where("uid=".$val['uid']." and state=4") -> delete(); | ||
409 | + } | ||
410 | + //改变老师的身份状态 | ||
395 | $data = Db::name('my_user') -> where('id',$id) -> update(['status'=>0,'pid'=>0,'is_pro'=>0,'bind_status'=>0,'is_withdrawal'=>1]); | 411 | $data = Db::name('my_user') -> where('id',$id) -> update(['status'=>0,'pid'=>0,'is_pro'=>0,'bind_status'=>0,'is_withdrawal'=>1]); |
396 | - $student = Db::name('my_user') -> where('pid',$id) -> update(['status'=>0,'pid'=>0,'bind_status'=>0]); | 412 | + //改变学生的身份状态 |
413 | + Db::name('my_user') -> where('pid',$id) -> update(['status'=>0,'pid'=>0,'bind_status'=>0]); | ||
397 | if($data){ | 414 | if($data){ |
398 | return true; | 415 | return true; |
399 | }else{ | 416 | }else{ |
@@ -18,11 +18,15 @@ class StatisticalController extends AdminBaseController{ | @@ -18,11 +18,15 @@ class StatisticalController extends AdminBaseController{ | ||
18 | $where2 = [ | 18 | $where2 = [ |
19 | 'indent_type' => 2 | 19 | 'indent_type' => 2 |
20 | ]; | 20 | ]; |
21 | + $where3 = [ | ||
22 | + 'type' => 1 | ||
23 | + ]; | ||
21 | if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){ | 24 | if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){ |
22 | $start_time = strtotime($_POST['start_time']); | 25 | $start_time = strtotime($_POST['start_time']); |
23 | $end_time = strtotime($_POST['end_time']); | 26 | $end_time = strtotime($_POST['end_time']); |
24 | $where['create_time'] = [['>=',$start_time],['<=',$end_time]]; | 27 | $where['create_time'] = [['>=',$start_time],['<=',$end_time]]; |
25 | $where2['create_time'] = [['>=',$start_time],['<=',$end_time]]; | 28 | $where2['create_time'] = [['>=',$start_time],['<=',$end_time]]; |
29 | + $where3['time'] = [['>=',$start_time],['<=',$end_time]]; | ||
26 | } | 30 | } |
27 | $platform = Db::name('indent') -> where($where) -> where("state = 2 or state = 3 or state = 5") -> select(); | 31 | $platform = Db::name('indent') -> where($where) -> where("state = 2 or state = 3 or state = 5") -> select(); |
28 | $platform_money = 0; | 32 | $platform_money = 0; |
@@ -37,6 +41,13 @@ class StatisticalController extends AdminBaseController{ | @@ -37,6 +41,13 @@ class StatisticalController extends AdminBaseController{ | ||
37 | $salesman_money += $val['money']; | 41 | $salesman_money += $val['money']; |
38 | } | 42 | } |
39 | $this -> assign('salesman_money',$salesman_money); | 43 | $this -> assign('salesman_money',$salesman_money); |
44 | + //显示平台抽成收益 | ||
45 | + $income = Db::name('income_money') -> where($where3) -> select(); | ||
46 | + $income_money = 0; | ||
47 | + foreach ($income as $key => $val){ | ||
48 | + $income_money += $val['money']; | ||
49 | + } | ||
50 | + $this -> assign('income_money',$income_money); | ||
40 | return $this -> fetch(); | 51 | return $this -> fetch(); |
41 | 52 | ||
42 | } | 53 | } |
-
请 注册 或 登录 后发表评论