...
|
...
|
@@ -53,7 +53,7 @@ class IndexController extends WeChatBaseController |
|
|
$data_update['bind_time'] = time();
|
|
|
$data_update['bind_status'] = 1;
|
|
|
Db::name('my_user') -> where('uid',$uid) -> update($data_update);
|
|
|
$data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}elseif ($data_id['status_id'] == 3){
|
|
|
//老师分享 更改用户身份为学生
|
|
|
$my_user_phone = Db::name('my_user') -> where('id',$data_id['my_user_id']) -> find();
|
...
|
...
|
@@ -65,7 +65,7 @@ class IndexController extends WeChatBaseController |
|
|
$data_update['bind_status'] = 1;
|
|
|
Db::name('my_user') -> where('uid',$uid) -> update($data_update);
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$my_user_phone['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
}
|
|
|
}else{
|
...
|
...
|
@@ -84,42 +84,42 @@ class IndexController extends WeChatBaseController |
|
|
$data_update['bind_time'] = time();
|
|
|
$data_update['bind_status'] = 1;
|
|
|
Db::name('my_user') -> where('uid',$uid) -> update($data_update);
|
|
|
$data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}else{
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
}else{
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
}else{
|
|
|
//当为业务员时显示的数据
|
|
|
if($data_my_user['status'] == 2){
|
|
|
$data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
//当为学生时显示的数据
|
|
|
if($data_my_user['status'] == 4){
|
|
|
$teacher_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$teacher_id['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
//当为业务员时显示的数据
|
|
|
if($data_my_user['status'] == 2){
|
|
|
$data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$data_my_user['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
//当为老师时显示的数据
|
|
|
if($data_my_user['status'] == 3){
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
//当为学生时显示的数据
|
|
|
if($data_my_user['status'] == 4){
|
|
|
$teacher_id = Db::name('my_user') -> where('id',$data_my_user['pid']) -> find();
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$teacher_id['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -142,7 +142,7 @@ class IndexController extends WeChatBaseController |
|
|
$data_inser['bind_time'] = time();
|
|
|
$data_inser['bind_status'] = 1;
|
|
|
Db::name('my_user') -> insert($data_inser);
|
|
|
$data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$my_user_phone['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}elseif ($data_id['status_id'] == 3){
|
|
|
//老师分享 添加学生
|
|
|
$my_user_phone = Db::name('my_user') -> where('id',$data_id['my_user_id']) -> find();
|
...
|
...
|
@@ -156,7 +156,7 @@ class IndexController extends WeChatBaseController |
|
|
$data_inser['bind_status'] = 1;
|
|
|
Db::name('my_user') -> insert($data_inser);
|
|
|
$salesman_id = Db::name('my_user') -> where('id',$my_user_phone['pid']) -> find();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> limit(3) -> select() -> toArray();
|
|
|
$data_goods = Db::name('goods') -> where('uid',$salesman_id['uid']) -> where('is_out',1) -> order("sort desc") -> limit(3) -> select() -> toArray();
|
|
|
}
|
|
|
}else{
|
|
|
$data_inser['status'] = 0;
|
...
|
...
|
|