This commit is contained in:
chenbo 2024-01-31 18:12:10 +08:00
parent 5806b3a0c6
commit d36a73b22d
6 changed files with 22 additions and 19 deletions

View File

@ -15,6 +15,7 @@
namespace app\api\logic\suyuan_operation; namespace app\api\logic\suyuan_operation;
use app\common\model\suyuan_operation\AnimalOperateAction;
use app\common\model\suyuan_operation\OperationDewormingLog; use app\common\model\suyuan_operation\OperationDewormingLog;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use think\facade\Db; use think\facade\Db;
@ -41,7 +42,7 @@ class OperationDewormingLogLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
Db::name('bs_animal_operate_action')->insert([ AnimalOperateAction::create([
'fence_house_id' => $params['fence_house_id'], 'fence_house_id' => $params['fence_house_id'],
'animal_info_id' => $params['animal_info_id']??0, 'animal_info_id' => $params['animal_info_id']??0,
'type' => 2, 'type' => 2,

View File

@ -15,6 +15,7 @@
namespace app\api\logic\suyuan_operation; namespace app\api\logic\suyuan_operation;
use app\common\model\suyuan_operation\AnimalOperateAction;
use app\common\model\suyuan_operation\OperationDisinfectLog; use app\common\model\suyuan_operation\OperationDisinfectLog;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use think\facade\Db; use think\facade\Db;
@ -73,7 +74,7 @@ class OperationDisinfectLogLogic extends BaseLogic
{ {
Db::startTrans(); Db::startTrans();
try { try {
Db::name('bs_animal_operate_action')->insert([ AnimalOperateAction::create([
'fence_house_id' => $params['fence_house_id'], 'fence_house_id' => $params['fence_house_id'],
'animal_info_id' => $params['animal_info_id']??0, 'animal_info_id' => $params['animal_info_id']??0,
'type' => 1, 'type' => 1,

View File

@ -15,6 +15,7 @@
namespace app\api\logic\suyuan_operation; namespace app\api\logic\suyuan_operation;
use app\common\model\suyuan_operation\AnimalOperateAction;
use app\common\model\suyuan_operation\OperationFeedingLog; use app\common\model\suyuan_operation\OperationFeedingLog;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use think\facade\Db; use think\facade\Db;
@ -41,7 +42,7 @@ class OperationFeedingLogLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
Db::name('bs_animal_operate_action')->insert([ AnimalOperateAction::create([
'fence_house_id' => $params['fence_house_id'], 'fence_house_id' => $params['fence_house_id'],
'animal_info_id' => $params['animal_info_id']??0, 'animal_info_id' => $params['animal_info_id']??0,
'type' => 3, 'type' => 3,

View File

@ -15,6 +15,7 @@
namespace app\api\logic\suyuan_operation; namespace app\api\logic\suyuan_operation;
use app\common\model\suyuan_operation\AnimalOperateAction;
use app\common\model\suyuan_operation\OperationVaccinumLog; use app\common\model\suyuan_operation\OperationVaccinumLog;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use think\facade\Db; use think\facade\Db;
@ -76,7 +77,7 @@ class OperationVaccinumLogLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
Db::name('bs_animal_operate_action')->insert([ AnimalOperateAction::create([
'fence_house_id' => $params['fence_house_id'], 'fence_house_id' => $params['fence_house_id'],
'animal_info_id' => $params['animal_info_id']??0, 'animal_info_id' => $params['animal_info_id']??0,
'type' => 4, 'type' => 4,

View File

@ -15,6 +15,7 @@
namespace app\api\logic\suyuan_operation; namespace app\api\logic\suyuan_operation;
use app\common\model\suyuan_operation\AnimalOperateAction;
use app\common\model\suyuan_operation\OperationWaterLog; use app\common\model\suyuan_operation\OperationWaterLog;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use think\facade\Db; use think\facade\Db;
@ -41,20 +42,20 @@ class OperationWaterLogLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { 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' => 5,
'type_text'=>'喂水',
'detail' => json_encode([
'animal_info_id' => $params['animal_info_id']??0,
'fence_house_id' => $params['fence_house_id'], 'fence_house_id' => $params['fence_house_id'],
'water_consumption' => $params['water_consumption'], 'animal_info_id' => $params['animal_info_id']??0,
'operator' => $params['operator'], 'type' => 5,
'pic' => $params['pic'], 'type_text'=>'喂水',
'remark' => $params['remark'], '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([ // OperationWaterLog::create([
// 'animal_info_id' => $params['animal_info_id']??0, // 'animal_info_id' => $params['animal_info_id']??0,

View File

@ -7,8 +7,6 @@ use app\common\model\BaseModel;
class AnimalOperateAction extends BaseModel class AnimalOperateAction extends BaseModel
{ {
protected $name = 'animal_operate_action'; protected $name = 'animal_operate_action';
protected $deleteTime = 'delete_time';
/** /**
* @notes 关联fenceHouseAttr * @notes 关联fenceHouseAttr