thinkphp中批量查找数据&thinkphp中批量往数据库中插入数据

一、thinkphp中批量查找数据

			$ids = [1,2,3,4];
            $map['id']  = array('IN',$ids);
            $sellers = M()->table('md_business')->where($map)->select();
            dump($sellers);

二、thinkphp中批量往数据库中插入数据

		$dataList =[
			array(
				'id'=>1,
				'name'=>'ljl'
			),
			array(
				'id'=>2,
				'name'=>gss
			)
		];
        $addRes = M()->table('md_ticket')->addAll($dataList);

你可能感兴趣的:(【02】ThinkPHP)