张进杰-ThinKPHP 3.1.3 更新指定where条件的单个数据

浏览:2004 发布日期:2016/06/15 分类:业务逻辑 关键字: 单个数据 更新 where
ThinKPHP 3.1.3 更新指定where()条件的单个数据。网站功能开发,仿站,联系专业工程师 QQ467477957
public function confirm(){
   $Dao=M('ota_in');
   $id=$_GET['id'];
  // echo $id;
    
// 需要更新的数据
    $data['confirm'] = '已消费';
    
// 更新的条件
    //$condition['id'] = '$id';
 
$result = $Dao->where("id='$id'")->save($data);
  

    if($result !== false){
        //echo '数据更新成功!';
$this->success('成功核销一条ota订单'); 
    }else{
        //echo '数据更新失败!'; 
$this->error('核销失败');
    }
   }
评论( 相关
后面还有条评论,点击查看>>