diff --git a/app/api/logic/suyuan_operation/OperationDewormingLogLogic.php b/app/api/logic/suyuan_operation/OperationDewormingLogLogic.php index b8b4c6e..e7dd776 100644 --- a/app/api/logic/suyuan_operation/OperationDewormingLogLogic.php +++ b/app/api/logic/suyuan_operation/OperationDewormingLogLogic.php @@ -15,6 +15,7 @@ namespace app\api\logic\suyuan_operation; +use app\common\model\suyuan_operation\AnimalOperateAction; use app\common\model\suyuan_operation\OperationDewormingLog; use app\common\logic\BaseLogic; use think\facade\Db; @@ -41,7 +42,7 @@ class OperationDewormingLogLogic extends BaseLogic Db::startTrans(); try { - Db::name('bs_animal_operate_action')->insert([ + AnimalOperateAction::create([ 'fence_house_id' => $params['fence_house_id'], 'animal_info_id' => $params['animal_info_id']??0, 'type' => 2, diff --git a/app/api/logic/suyuan_operation/OperationDisinfectLogLogic.php b/app/api/logic/suyuan_operation/OperationDisinfectLogLogic.php index e7bcfa1..39b8bff 100644 --- a/app/api/logic/suyuan_operation/OperationDisinfectLogLogic.php +++ b/app/api/logic/suyuan_operation/OperationDisinfectLogLogic.php @@ -15,6 +15,7 @@ namespace app\api\logic\suyuan_operation; +use app\common\model\suyuan_operation\AnimalOperateAction; use app\common\model\suyuan_operation\OperationDisinfectLog; use app\common\logic\BaseLogic; use think\facade\Db; @@ -73,7 +74,7 @@ class OperationDisinfectLogLogic extends BaseLogic { Db::startTrans(); try { - Db::name('bs_animal_operate_action')->insert([ + AnimalOperateAction::create([ 'fence_house_id' => $params['fence_house_id'], 'animal_info_id' => $params['animal_info_id']??0, 'type' => 1, diff --git a/app/api/logic/suyuan_operation/OperationFeedingLogLogic.php b/app/api/logic/suyuan_operation/OperationFeedingLogLogic.php index 9c7c454..241749c 100644 --- a/app/api/logic/suyuan_operation/OperationFeedingLogLogic.php +++ b/app/api/logic/suyuan_operation/OperationFeedingLogLogic.php @@ -15,6 +15,7 @@ namespace app\api\logic\suyuan_operation; +use app\common\model\suyuan_operation\AnimalOperateAction; use app\common\model\suyuan_operation\OperationFeedingLog; use app\common\logic\BaseLogic; use think\facade\Db; @@ -41,7 +42,7 @@ class OperationFeedingLogLogic extends BaseLogic Db::startTrans(); try { - Db::name('bs_animal_operate_action')->insert([ + AnimalOperateAction::create([ 'fence_house_id' => $params['fence_house_id'], 'animal_info_id' => $params['animal_info_id']??0, 'type' => 3, diff --git a/app/api/logic/suyuan_operation/OperationVaccinumLogLogic.php b/app/api/logic/suyuan_operation/OperationVaccinumLogLogic.php index 446817c..5eff632 100644 --- a/app/api/logic/suyuan_operation/OperationVaccinumLogLogic.php +++ b/app/api/logic/suyuan_operation/OperationVaccinumLogLogic.php @@ -15,6 +15,7 @@ namespace app\api\logic\suyuan_operation; +use app\common\model\suyuan_operation\AnimalOperateAction; use app\common\model\suyuan_operation\OperationVaccinumLog; use app\common\logic\BaseLogic; use think\facade\Db; @@ -76,7 +77,7 @@ class OperationVaccinumLogLogic extends BaseLogic Db::startTrans(); try { - Db::name('bs_animal_operate_action')->insert([ + AnimalOperateAction::create([ 'fence_house_id' => $params['fence_house_id'], 'animal_info_id' => $params['animal_info_id']??0, 'type' => 4, diff --git a/app/api/logic/suyuan_operation/OperationWaterLogLogic.php b/app/api/logic/suyuan_operation/OperationWaterLogLogic.php index b2fb30d..8ce68f0 100644 --- a/app/api/logic/suyuan_operation/OperationWaterLogLogic.php +++ b/app/api/logic/suyuan_operation/OperationWaterLogLogic.php @@ -15,6 +15,7 @@ namespace app\api\logic\suyuan_operation; +use app\common\model\suyuan_operation\AnimalOperateAction; use app\common\model\suyuan_operation\OperationWaterLog; use app\common\logic\BaseLogic; use think\facade\Db; @@ -41,20 +42,20 @@ class OperationWaterLogLogic extends BaseLogic Db::startTrans(); try { - Db::name('bs_animal_operate_action')->insert([ - 'fence_house_id' => $params['fence_house_id'], - 'animal_info_id' => $params['animal_info_id']??0, - 'type' => 5, - 'type_text'=>'喂水', - 'detail' => json_encode([ - 'animal_info_id' => $params['animal_info_id']??0, + AnimalOperateAction::create([ 'fence_house_id' => $params['fence_house_id'], - 'water_consumption' => $params['water_consumption'], - 'operator' => $params['operator'], - 'pic' => $params['pic'], - 'remark' => $params['remark'], - ]) - ]); + 'animal_info_id' => $params['animal_info_id']??0, + 'type' => 5, + 'type_text'=>'喂水', + 'detail' => json_encode([ + 'animal_info_id' => $params['animal_info_id']??0, + 'fence_house_id' => $params['fence_house_id'], + 'water_consumption' => $params['water_consumption'], + 'operator' => $params['operator'], + 'pic' => $params['pic'], + 'remark' => $params['remark'], + ]) + ]); // OperationWaterLog::create([ // 'animal_info_id' => $params['animal_info_id']??0, diff --git a/app/common/model/suyuan_operation/AnimalOperateAction.php b/app/common/model/suyuan_operation/AnimalOperateAction.php index 2a16d40..f943710 100644 --- a/app/common/model/suyuan_operation/AnimalOperateAction.php +++ b/app/common/model/suyuan_operation/AnimalOperateAction.php @@ -7,8 +7,6 @@ use app\common\model\BaseModel; class AnimalOperateAction extends BaseModel { protected $name = 'animal_operate_action'; - protected $deleteTime = 'delete_time'; - /** * @notes 关联fenceHouseAttr