diff --git a/app/api/controller/ActionController.php b/app/api/controller/ActionController.php index 3b2679aa..ef3455fb 100644 --- a/app/api/controller/ActionController.php +++ b/app/api/controller/ActionController.php @@ -67,6 +67,7 @@ } Db::transaction(function()use($params,$plant,$land){ Action::create([ + 'user_id' => $plant['user_id'], 'plant_id' => $params['plant_id'], 'type' => $params['type'], 'type_text' => $this->actionMessage[$params['type']], diff --git a/app/api/controller/DeviceController.php b/app/api/controller/DeviceController.php index e56a13cf..eb2f6f1f 100644 --- a/app/api/controller/DeviceController.php +++ b/app/api/controller/DeviceController.php @@ -36,6 +36,7 @@ Db::transaction(function()use($land,$device) { Device::where('id',$device['id'])->update([ 'is_bind' => 2, + 'user_id' => $land['user_id'], 'update_time' => time() ]); LandDevice::create([ diff --git a/app/api/controller/PlantController.php b/app/api/controller/PlantController.php index 7f3eaa4e..95bbfaf7 100644 --- a/app/api/controller/PlantController.php +++ b/app/api/controller/PlantController.php @@ -51,6 +51,7 @@ Db::transaction(function()use($params,$land) { Plant::create([ 'land_id' => $params['land_id'], + 'user_id' => $land['user_id'], 'kind' => $params['kind'], 'breed' => $params['breed'], 'area' => $params['area'],