第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從數(shù)據(jù)庫codeigniter中扣除價值

如何從數(shù)據(jù)庫codeigniter中扣除價值

PHP
ibeautiful 2022-01-14 16:42:52
我目前在將值從數(shù)據(jù)庫中扣除到我的字段時遇到問題這是我的代碼在我的模型中,我有一個名為 deductpublic function deduct($id){        $data = array(            'loan' => $this->input->post('loan'),            'id' => $id,            'loan_type' => $this->input->post('loan_type'),            'loan_amount' => $this->input->post('loan_amount'),            'firstname' => $this->input->post('firstname'),            'lastname' => $this->input->post('lastname'),            'middlename' => $this->input->post('middlename'),            'gender' => $this->input->post('gender'),            'civilstatus' => $this->input->post('civilstatus'),            'birthday' => $this->input->post('birthday'),            'age' => $this->input->post('age'),            'dependents' => $this->input->post('dependents'),            'spousefirstname' => $this->input->post('spousefirstname'),            'spouselastname' => $this->input->post('spouselastname'),            'spousemiddlename' => $this->input->post('spousemiddlename'),            'spouseage' => $this->input->post('spouseage'),            'spousebirthday' => $this->input->post('spousebirthday'),            'homeaddress' => $this->input->post('homeaddress'),            'zipcode' => $this->input->post('zipcode'),            'lengthofstay' => $this->input->post('lengthofstay'),            'hometype' => $this->input->post('hometype'),        );    }
查看完整描述

1 回答

?
汪汪一只貓

TA貢獻1898條經(jīng)驗 獲得超8個贊

$this->db->set('loan_amount','loan_amount-balance', false);它不會生效,因為您設(shè)置$data了$this->db->update('employee',$data);.


這將解決您的問題:)


public function deduct($id){


        $data = array(

            'loan' => $this->input->post('loan'),

            'id' => $id,

            'loan_type' => $this->input->post('loan_type'),

            'loan_amount' => $this->input->post('loan_amount') - $this->input->post('cash_amount'),

            'firstname' => $this->input->post('firstname'),

            'lastname' => $this->input->post('lastname'),

            'middlename' => $this->input->post('middlename'),

            'gender' => $this->input->post('gender'),

            'civilstatus' => $this->input->post('civilstatus'),

            'birthday' => $this->input->post('birthday'),

            'age' => $this->input->post('age'),

            'dependents' => $this->input->post('dependents'),

            'spousefirstname' => $this->input->post('spousefirstname'),

            'spouselastname' => $this->input->post('spouselastname'),

            'spousemiddlename' => $this->input->post('spousemiddlename'),

            'spouseage' => $this->input->post('spouseage'),

            'spousebirthday' => $this->input->post('spousebirthday'),

            'homeaddress' => $this->input->post('homeaddress'),

            'zipcode' => $this->input->post('zipcode'),

            'lengthofstay' => $this->input->post('lengthofstay'),

            'hometype' => $this->input->post('hometype'),

            'emailaddress' => $this->input->post('emailaddress'),

            'homephonenumber' => $this->input->post('homephonenumber'),

            'businessphonenumber' => $this->input->post('businessphonenumber'),

            'mobilenumber' => $this->input->post('mobilenumber'),

            'nameofbusiness' => $this->input->post('nameofbusiness'),

            'natureofbusiness' => $this->input->post('natureofbusiness'),

            'addressofbusiness' => $this->input->post('addressofbusiness'),

            'yearsofbusiness' => $this->input->post('yearsofbusiness'),

            'nameofcomaker' => $this->input->post('nameofcomaker'),

            'addressofcomaker' => $this->input->post('addressofcomaker'),

            'numberofcomaker' => $this->input->post('numberofcomaker'),

            'balance' => $this->input->post('cash_amount')

        );


        $this->db->where('id', $id);

        $this->db->update('employee',$data);

    }



查看完整回答
反對 回復(fù) 2022-01-14
  • 1 回答
  • 0 關(guān)注
  • 133 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號