1.查 public function userTest(){ return $this->all(); }
public function userTest(){ return $this->get(参数); }
2.增 public function usrAdd(){
$this->user_name =‘zhanfa‘; $this->password =‘21‘; $this->save();}
public function usrAdd(){ $user_data = [‘username‘ =>‘user2‘, ‘age‘ => ‘21‘]; $this->fill($user_data); $this->save();}3.更改
public function userUpdata(){ $user_data =$this->where(‘user_id‘,‘2‘); $user_data->update(‘user_name‘ =>"zjang".‘age‘=>‘21‘); }4.删
public function userdete(){ $user = $this->find(参数); $user->delete(); }
时间: 2024-10-07 06:10:16