if ($cart_info) {
$data['num'] = intval($cart_info['num']) intval($num);
//Judge inventory
if (intval($check_info['num'])<=$data['num']) {
echo json_encode(array('status'=>0,'err '=>'Out of stock!'));
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']='Add'
$res=$shpp->add($data);
}
##$res=$shpp->add($data); Return after adding the record ID=1
But my database ID value is 5,
The ID of the database is not synchronized with the newly added records.