diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index 302d8930..96ec6367 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -27,6 +27,7 @@ use Symfony\Component\HttpClient\HttpClient; use think\cache\driver\Redis; use think\facade\Db; use think\facade\Log; +use think\Model; use think\model\Pivot; use think\response\Json; @@ -38,7 +39,9 @@ use think\response\Json; */ class IndexController extends BaseApiController { - public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl', 'notifyProperty', 'notifyAuthentication', 'notifyVehicleContractUpdate','townCarRent','systemCarRent', 'selfCarRent', 'cancelRent', 'buyCar', 'vehicleCarList']; + public array $notNeedLogin = ['index', 'config', 'policy', 'decorate', 'notifyUrl', 'notifyProperty', + 'notifyAuthentication', 'notifyVehicleContractUpdate','townCarRent','systemCarRent', 'selfCarRent', + 'cancelRent', 'buyCar', 'vehicleCarList', 'addVillagerInfo']; /** * @notes 首页数据 @@ -820,4 +823,19 @@ class IndexController extends BaseApiController Db::name('company_authentication_fail_log')->insert(['company_id'=>$parmas['id'], 'log_type'=>3, 'fail_reason'=>$data['msg'], 'create_time'=>time()]); } } + + public function addVillagerInfo() + { + $params = $this->request->post(); + $params['house_rent_info'] = json_encode($params['house_rent_info']); + $params['land_rent_info'] = json_encode($params['land_rent_info']); + $params['product_info'] = json_encode($params['product_info']); + $params['idle_asset_rent_info'] = json_encode($params['idle_asset_rent_info']); + $params['house_decoration_construction'] = json_encode($params['house_decoration_construction']); + $params['create_time'] = time(); + $params['update_time'] = time(); + $model = Db::name('villager_information')->insertGetId($params); + + return $this->success('添加成功'); + } }