摘要:namespace app\index\controller;use think\Db;class zuoye{public function cha(){Db::table('shangpin')->field('name&
namespace app\index\controller;
use think\Db;
class zuoye
{
public function cha(){
Db::table('shangpin')->field('name','jiage')->where(['jiage','>',500])->select();
}
public function charu(){
$data=[数组,插入内容];
Db::table('shangpin')->data($data)->insert();
}
public function gengxin(){
$data=[数组,更新内容];
Db::table('shangpin')->where(['jiage'=>250])->data($data)->update();
}
public function shanchu(){
Db::table('shangpin')->where(['jiage'=>250])->delete();
}
}
批改老师:韦小宝批改时间:-02-14 09:07:57
老师总结:$data=[数组,插入内容]; 你这里是$data是什么呢?这是在模拟的么?