...
|
...
|
@@ -245,24 +245,27 @@ class GoodsdetailsController extends WeChatBaseController{ |
|
|
$uid = cmf_get_current_user_id();
|
|
|
$goods_uid = Db::name('goods') -> where("id",$_POST['goods_id']) -> find();
|
|
|
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
|
|
|
if($my_user['status'] == 3){
|
|
|
$salesman_user = Db::name('my_user') -> where('id',$my_user['pid']) -> find();
|
|
|
}
|
|
|
if($my_user['status'] == 4){
|
|
|
$teacher_user = Db::name('my_user') -> where('id',$my_user['pid']) -> find();
|
|
|
$salesman_user = Db::name('my_user') -> where('id',$teacher_user['pid']) -> find();
|
|
|
}
|
|
|
if(!empty($salesman_user)){
|
|
|
if($goods_uid['uid'] == $salesman_user['uid']){
|
|
|
return true;
|
|
|
if($goods_uid['type'] == 1){
|
|
|
return true;
|
|
|
}else{
|
|
|
if($my_user['status'] == 3){
|
|
|
$salesman_user = Db::name('my_user') -> where('id',$my_user['pid']) -> find();
|
|
|
}
|
|
|
if($my_user['status'] == 4){
|
|
|
$teacher_user = Db::name('my_user') -> where('id',$my_user['pid']) -> find();
|
|
|
$salesman_user = Db::name('my_user') -> where('id',$teacher_user['pid']) -> find();
|
|
|
}
|
|
|
if(!empty($salesman_user)){
|
|
|
if($goods_uid['uid'] == $salesman_user['uid']){
|
|
|
return true;
|
|
|
}else{
|
|
|
return false;
|
|
|
}
|
|
|
}else{
|
|
|
return false;
|
|
|
return true;
|
|
|
}
|
|
|
}else{
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|