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

54

... ... @@ -54,7 +54,9 @@ class SalesmanorderController extends AdminBaseController{
}
$data_school = Db::name('indent') -> group('school') -> where('indent_type',2) -> select() -> toArray();
foreach($data_school as $key => $val){
$school[$key] = $val['school'];
if(!empty($val['school'])){
$school[$key] = $val['school'];
}
}
$uid = Db::name('my_user') -> alias('a') -> join('user b','a.uid = b.id','LEFT') -> where('a.status = 2') -> select();
/* foreach($uid as $key => $val){
... ...
... ... @@ -91,6 +91,11 @@ class GoodsdetailsController extends WeChatBaseController{
public function goodsdetails_go_pay(){
$uid = cmf_get_current_user_id();
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
if($my_user['status'] == 2){
$ret['type'] = 20;
return json_encode($ret);
}
$goods_id = $_POST['id'];
$data[] = Db::name('goods') -> where('id',$goods_id) -> find();
$data[0]['book_num'] = 1;
... ...
... ... @@ -169,7 +169,9 @@
price = {$price};
$.post("{:url('Goodsdetails/goodsdetails_go_pay')}",{id:id,myprice:price},function(data){
obj = JSON.parse(data);
if(obj.type == 3){
if(obj.type == 20){
alert('业务员不能购买');
}if(obj.type == 3){
alert('业务员商品和平台商品不能同时购买!');
}else if(obj.type == 1){
window.location.href = "{:url('Orderpage/order_page')}?indet_id="+obj.indet_id;
... ...