use think\Db;
 $orderaid = Db::name('recharge_order')
            ->where('paycon_id',$aid)   

->select();

 $subject->setInc("votes");加一

->setDec('whNum',3);

Db::table('fa_companyinfo')->where('comId',$cid)->setDec('whNum');减一

$cominfo=Db::table('fa_companyinfo')->where('comId',$cid)->select();

$cominfo[0]['whNum']

$rId = Db::name($table)->insertGetId($itemC);

insertGetId($itemC,true);



报错:miss update condition

$updateCondition = array();
$updateCondition['id'] = $aid;
      unset($name);unset($vl);
        \think\Db::name($channel["addtable"])->update($updateCondition,$subData);

上面改外还是错,就是不成功的话更新返回0,可以判断一下


$res=\think\Db::name($channel["addtable"])->where('id',intval($aid))->update($subData);

排除某些字段只要剩下的,这一句多表的时候可能会报冲突


->field(['password', 'salt', 'token'], true)


tp5给某个字段增加减少值
减少:

$this->model->where('drug_id', $row['drug_id'])->setDec('number',$post['number'])
增加:

$this->model->where('drug_id', $row['drug_id'])->setInc('number',$post['number'])

tp6给某个字段增加减少值
减少:

$this->model->where('drug_id', $row['drug_id'])->dec('number',$post['number'])->update();
增加

$this->model->where('drug_id', $row['drug_id'])->inc('number',$post['number'])->update();
Db::name('ykjp_delivery')->getLastInsID(); //获取刚插入数据的ID

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
返回
顶部