abstract:field('*') -
field('*') ->where('id',7) ->find(); dump($abc); } public function select() { $abc = Db::table('task') ->field('*') ->where('type','刀') ->order('price','DESC') ->limit(5) ->select(); dump($abc); } public function insert() { $data = [ 'name' => '妖刀村正', 'date' => '1993-5-9', 'price' => '3526', 'type' => '刀' ]; $ab = Db::table('task')->insert($data); $id = Db::getLastInsID(); // return $ab ? '添加成功,id='.$id : '无添加记录!'; $data1 = [ ['name'=>'天丛云剑','date'=>'1992-4-6','price'=>3848,'type'=>'剑'], ['name'=>'初代鬼彻','date'=>'1997-9-12','price'=>3457,'type'=>'刀'], ['name'=>'三代鬼彻','date'=>'1994-8-23','price'=>3752,'type'=>'刀'], ]; $nam = Db::table('task')->data($data1)->insertAll(); return $nam ? '添加成功'.$nam.'条记录>.<' : '无添加记录!'; } public function update() { $a = Db::table('task') ->where('price','<',4000) ->data(['price'=>Db::raw('price+1000')]) ->update(); return $a ? '更新成功'.$a.'条记录>.<' : '无记录更新!'; } public function delete() { // $d = Db::table('task')->delete([6,7,8]); $d = Db::table('task')->where('name','妖刀村正')->delete(); return $d ? '删除成功'.$d.'条记录>.<' : '无删除记录1'; } }
Correcting teacher:查无此人Correction time:2019-04-17 09:08:32
Teacher's summary:完成的不错,不过你的返回怎么用dump?修改下吧。继续加油