if ($cart_info) {
$data['num'] = intval($cart_info['num']) intval($num);
//判斷庫存
if (intval($check_info['num'])<=$data['num']) {
# echo json_encode(array('status'=>0,'err '=>'庫存不足!'));
exit;
}
# $res = $shpp->where('id='.intval( $cart_info['id']))->save($data);
}else{
$data['pid']=intval($pid);
$data['num']=intval($num);
$data['addtime']=time();
$data['uid']=intval ($uid);
$data['shop_id']=intval($check_info['shop_id']);
$ptype = 1;
# if (intval ($check_info['pro_type'])) {
$ptype = intval($check_info['pro_type']);
}
$data['type' ]=$ptype;
$data['price'] = $check_info['price_yh'];
$data['aa']='增加'