// +---------------------------------------------------------------------- namespace app\controller; use app\controller\Base; /** * @title 首页 */ class Index extends Base{ /** * @title 首页 * * @return void */ public function index(){ if(request()->isAjax()){ return ['code' => 1, 'data' => 'SentOS']; }else{ return view('/index'); } } public function test(){ // $area = \think\facade\Db::name('areas')->select(); // $save = []; // foreach($area as $val){ // $save[] = ['title' => $val['area'], 'code' => $val['area_id'], 'parent_id' => $val['city_id'], 'first' => '', 'create_time' => time(), 'update_time' => time()]; // } // \think\facade\Db::name('area')->insertAll($save); } }