作者 anyv
1 个管道 的构建 通过 耗费 0 秒

首页排序

@@ -53,7 +53,7 @@ class IndexController extends WeChatBaseController @@ -53,7 +53,7 @@ class IndexController extends WeChatBaseController
53 $data_update['bind_time'] = time(); 53 $data_update['bind_time'] = time();
54 $data_update['bind_status'] = 1; 54 $data_update['bind_status'] = 1;
55 Db::name('my_user') -> where('uid',$uid) -> update($data_update); 55 Db::name('my_user') -> where('uid',$uid) -> update($data_update);
56 - $data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 56 + $data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
57 }elseif ($data_id['status_id'] == 3){ 57 }elseif ($data_id['status_id'] == 3){
58 //老师分享 更改用户身份为学生 58 //老师分享 更改用户身份为学生
59 $my_user_phone = Db::name('my_user') -> where('id',$data_id['my_user_id']) -> find(); 59 $my_user_phone = Db::name('my_user') -> where('id',$data_id['my_user_id']) -> find();
@@ -65,7 +65,7 @@ class IndexController extends WeChatBaseController @@ -65,7 +65,7 @@ class IndexController extends WeChatBaseController
65 $data_update['bind_status'] = 1; 65 $data_update['bind_status'] = 1;
66 Db::name('my_user') -> where('uid',$uid) -> update($data_update); 66 Db::name('my_user') -> where('uid',$uid) -> update($data_update);
67 $salesman_id = Db::name('my_user') -> where('id',$my_user_phone['pid']) -> find(); 67 $salesman_id = Db::name('my_user') -> where('id',$my_user_phone['pid']) -> find();
68 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 68 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
69 } 69 }
70 } 70 }
71 }else{ 71 }else{
@@ -84,42 +84,42 @@ class IndexController extends WeChatBaseController @@ -84,42 +84,42 @@ class IndexController extends WeChatBaseController
84 $data_update['bind_time'] = time(); 84 $data_update['bind_time'] = time();
85 $data_update['bind_status'] = 1; 85 $data_update['bind_status'] = 1;
86 Db::name('my_user') -> where('uid',$uid) -> update($data_update); 86 Db::name('my_user') -> where('uid',$uid) -> update($data_update);
87 - $data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 87 + $data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
88 }else{ 88 }else{
89 $salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find(); 89 $salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
90 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 90 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
91 } 91 }
92 }else{ 92 }else{
93 $salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find(); 93 $salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
94 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 94 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
95 } 95 }
96 }else{ 96 }else{
97 //当为业务员时显示的数据 97 //当为业务员时显示的数据
98 if($data_my_user['status'] == 2){ 98 if($data_my_user['status'] == 2){
99 - $data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 99 + $data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
100 } 100 }
101 //当为学生时显示的数据 101 //当为学生时显示的数据
102 if($data_my_user['status'] == 4){ 102 if($data_my_user['status'] == 4){
103 $teacher_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find(); 103 $teacher_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
104 $salesman_id = Db::name('my_user') -> where('id',$teacher_id['pid']) -> find(); 104 $salesman_id = Db::name('my_user') -> where('id',$teacher_id['pid']) -> find();
105 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 105 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
106 } 106 }
107 } 107 }
108 }else{ 108 }else{
109 //当为业务员时显示的数据 109 //当为业务员时显示的数据
110 if($data_my_user['status'] == 2){ 110 if($data_my_user['status'] == 2){
111 - $data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 111 + $data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
112 } 112 }
113 //当为老师时显示的数据 113 //当为老师时显示的数据
114 if($data_my_user['status'] == 3){ 114 if($data_my_user['status'] == 3){
115 $salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find(); 115 $salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
116 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 116 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
117 } 117 }
118 //当为学生时显示的数据 118 //当为学生时显示的数据
119 if($data_my_user['status'] == 4){ 119 if($data_my_user['status'] == 4){
120 $teacher_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find(); 120 $teacher_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
121 $salesman_id = Db::name('my_user') -> where('id',$teacher_id['pid']) -> find(); 121 $salesman_id = Db::name('my_user') -> where('id',$teacher_id['pid']) -> find();
122 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 122 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
123 } 123 }
124 } 124 }
125 125
@@ -142,7 +142,7 @@ class IndexController extends WeChatBaseController @@ -142,7 +142,7 @@ class IndexController extends WeChatBaseController
142 $data_inser['bind_time'] = time(); 142 $data_inser['bind_time'] = time();
143 $data_inser['bind_status'] = 1; 143 $data_inser['bind_status'] = 1;
144 Db::name('my_user') -> insert($data_inser); 144 Db::name('my_user') -> insert($data_inser);
145 - $data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 145 + $data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
146 }elseif ($data_id['status_id'] == 3){ 146 }elseif ($data_id['status_id'] == 3){
147 //老师分享 添加学生 147 //老师分享 添加学生
148 $my_user_phone = Db::name('my_user') -> where('id',$data_id['my_user_id']) -> find(); 148 $my_user_phone = Db::name('my_user') -> where('id',$data_id['my_user_id']) -> find();
@@ -156,7 +156,7 @@ class IndexController extends WeChatBaseController @@ -156,7 +156,7 @@ class IndexController extends WeChatBaseController
156 $data_inser['bind_status'] = 1; 156 $data_inser['bind_status'] = 1;
157 Db::name('my_user') -> insert($data_inser); 157 Db::name('my_user') -> insert($data_inser);
158 $salesman_id = Db::name('my_user') -> where('id',$my_user_phone['pid']) -> find(); 158 $salesman_id = Db::name('my_user') -> where('id',$my_user_phone['pid']) -> find();
159 - $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray(); 159 + $data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
160 } 160 }
161 }else{ 161 }else{
162 $data_inser['status'] = 0; 162 $data_inser['status'] = 0;