Merge branch 'Beta' of https://github.com/Shu-Ying/zhenxun_plugin_farm into Beta
This commit is contained in:
+28
-1
@@ -18,7 +18,7 @@ class CUserSoilDB(CSqlManager):
|
||||
#matureTime: 成熟时间
|
||||
#soilLevel: 土地等级 0=普通地,1=红土地,2=黑土地,3=金土地
|
||||
#wiltStatus: 枯萎状态 0=未枯萎,1=枯萎
|
||||
#fertilizerStatus: 施肥状态 0=未施肥,1=施肥
|
||||
#fertilizerStatus: 施肥状态 0=未施肥,1=施肥 2=增肥
|
||||
#bugStatus: 虫害状态 0=无虫害,1=有虫害
|
||||
#weedStatus: 杂草状态 0=无杂草,1=有杂草
|
||||
#waterStatus: 缺水状态 0=不缺水,1=缺水
|
||||
@@ -349,3 +349,30 @@ class CUserSoilDB(CSqlManager):
|
||||
except Exception as e:
|
||||
logger.error(f"播种失败!", e=e)
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
async def getUserSoilStatus(cls, uid: str, soilIndex: int) -> str:
|
||||
status = []
|
||||
soilInfo = await g_pDBService.userSoil.getUserSoil(uid, soilIndex)
|
||||
|
||||
if not soilInfo:
|
||||
return ""
|
||||
|
||||
if soilInfo.get("wiltStatus", 0) == 1:
|
||||
return "枯萎"
|
||||
|
||||
if soilInfo.get("fertilizerStatus", 0) == 1:
|
||||
status.append("施肥")
|
||||
elif soilInfo.get("fertilizerStatus", 0) == 2:
|
||||
status.append("增肥")
|
||||
|
||||
if soilInfo.get("bugStatus", 0) == 1:
|
||||
status.append("虫害")
|
||||
|
||||
if soilInfo.get("weedStatus", 0) == 1:
|
||||
status.append("杂草")
|
||||
|
||||
if soilInfo.get("waterStatus", 0) == 1:
|
||||
status.append("缺水")
|
||||
|
||||
return ",".join(status)
|
||||
|
||||
Reference in New Issue
Block a user