|
@@ -1,6 +1,5 @@
|
|
|
import Common
|
|
|
from LocalModel import BaZi, SiZhuWeiZhi, SiZhu, ShenSha
|
|
|
-from model import Tianyiguiren, ShenshaTips, Zaisha, Shishenzhilu, Tiangan, Dashe, Yima, Zhangsheng, Huagai, Taohua
|
|
|
|
|
|
|
|
|
def check_shenshas(bazi: BaZi):
|
|
@@ -65,331 +64,335 @@ def __fill_data_in_bazi(key: str, name: str, tip: str, bazi: BaZi):
|
|
|
|
|
|
def __check_tianyiguiren(bazi: BaZi):
|
|
|
key = "天乙贵人"
|
|
|
- dts = Tianyiguiren.select().where(Tianyiguiren.niangan == bazi.nianGan.text)
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- if len(dts) > 0:
|
|
|
- for dt in dts:
|
|
|
- if bazi.nianZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.nianzhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
- if bazi.yueZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
- if bazi.riZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.rizhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
- if bazi.shiZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
-
|
|
|
- dts2 = Tianyiguiren.select().where(Tianyiguiren.rigan == bazi.riGan.text)
|
|
|
- if len(dts2) > 0:
|
|
|
- for dt in dts2:
|
|
|
- if bazi.nianZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.nianzhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
- if bazi.yueZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
- if bazi.riZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.rizhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
- if bazi.shiZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- bazi.add_shensha(wz, key, tip)
|
|
|
+ # dts = Tianyiguiren.select().where(Tianyiguiren.niangan == bazi.nianGan.text)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # if len(dts) > 0:
|
|
|
+ # for dt in dts:
|
|
|
+ # if bazi.nianZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.nianzhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ # if bazi.yueZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ # if bazi.riZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.rizhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ # if bazi.shiZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ #
|
|
|
+ # dts2 = Tianyiguiren.select().where(Tianyiguiren.rigan == bazi.riGan.text)
|
|
|
+ # if len(dts2) > 0:
|
|
|
+ # for dt in dts2:
|
|
|
+ # if bazi.nianZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.nianzhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ # if bazi.yueZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ # if bazi.riZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.rizhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
+ # if bazi.shiZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # bazi.add_shensha(wz, key, tip)
|
|
|
|
|
|
|
|
|
def __check_zaisha(bazi: BaZi):
|
|
|
key = "灾煞"
|
|
|
- dts = Zaisha.select().where(Zaisha.nianzhi == bazi.nianZhi.text)
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- if len(dts) > 0:
|
|
|
- for dt in dts:
|
|
|
- if bazi.yueZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- dz = SiZhuWeiZhi.yuezhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
- if bazi.riZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.rizhu
|
|
|
- dz = SiZhuWeiZhi.rizhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
- if bazi.shiZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- dz = SiZhuWeiZhi.shizhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
- dts2 = Zaisha.select().where(Zaisha.rizhi == bazi.riZhi.text)
|
|
|
- if len(dts2) > 0:
|
|
|
- for dt in dts2:
|
|
|
- wz = SiZhuWeiZhi.unknown
|
|
|
- if bazi.nianZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.nianzhu
|
|
|
- dz = SiZhuWeiZhi.nianzhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
- if bazi.yueZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- dz = SiZhuWeiZhi.yuezhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
- if bazi.shiZhi.text == dt.dizhi:
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- dz = SiZhuWeiZhi.shizhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
+ # dts = Zaisha.select().where(Zaisha.nianzhi == bazi.nianZhi.text)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # if len(dts) > 0:
|
|
|
+ # for dt in dts:
|
|
|
+ # if bazi.yueZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # dz = SiZhuWeiZhi.yuezhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
+ # if bazi.riZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.rizhu
|
|
|
+ # dz = SiZhuWeiZhi.rizhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
+ # if bazi.shiZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # dz = SiZhuWeiZhi.shizhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
+ # dts2 = Zaisha.select().where(Zaisha.rizhi == bazi.riZhi.text)
|
|
|
+ # if len(dts2) > 0:
|
|
|
+ # for dt in dts2:
|
|
|
+ # wz = SiZhuWeiZhi.unknown
|
|
|
+ # if bazi.nianZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.nianzhu
|
|
|
+ # dz = SiZhuWeiZhi.nianzhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
+ # if bazi.yueZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # dz = SiZhuWeiZhi.yuezhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
+ # if bazi.shiZhi.text == dt.dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # dz = SiZhuWeiZhi.shizhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_zaisha_effect(bazi, dz))
|
|
|
|
|
|
|
|
|
def __check_wenchangxing(bazi: BaZi):
|
|
|
key = "文昌星"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- if bazi.nianGan.shiShen == "食":
|
|
|
- dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.nianGan.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if bazi.nianZhi.text == dts[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.yueGan.shiShen == "食":
|
|
|
- dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.yueGan.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if bazi.yueZhi.text == dts[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.shiGan.shiShen == "食":
|
|
|
- dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.shiGan.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if bazi.shiZhi.text == dts[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # if bazi.nianGan.shiShen == "食":
|
|
|
+ # dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.nianGan.text)
|
|
|
+ # if len(dts) > 0:
|
|
|
+ # if bazi.nianZhi.text == dts[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.yueGan.shiShen == "食":
|
|
|
+ # dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.yueGan.text)
|
|
|
+ # if len(dts) > 0:
|
|
|
+ # if bazi.yueZhi.text == dts[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.shiGan.shiShen == "食":
|
|
|
+ # dts = Shishenzhilu.select().where(Shishenzhilu.tiangan == bazi.shiGan.text)
|
|
|
+ # if len(dts) > 0:
|
|
|
+ # if bazi.shiZhi.text == dts[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_lushen(bazi: BaZi):
|
|
|
key = "禄神"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- dts1 = Tiangan.select().where(Tiangan.name == bazi.nianGan.text)
|
|
|
- if len(dts1) > 0:
|
|
|
- if bazi.nianZhi.text == dts1[0].linguan:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- dts2 = Tiangan.select().where(Tiangan.name == bazi.yueGan.text)
|
|
|
- if len(dts2) > 0:
|
|
|
- if bazi.yueZhi.text == dts2[0].linguan:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- dts3 = Tiangan.select().where(Tiangan.name == bazi.riGan.text)
|
|
|
- if len(dts3) > 0:
|
|
|
- if bazi.riZhi.text == dts3[0].linguan:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- dts4 = Tiangan.select().where(Tiangan.name == bazi.shiGan.text)
|
|
|
- if len(dts4) > 0:
|
|
|
- if bazi.shiZhi.text == dts4[0].linguan:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # dts1 = Tiangan.select().where(Tiangan.name == bazi.nianGan.text)
|
|
|
+ # if len(dts1) > 0:
|
|
|
+ # if bazi.nianZhi.text == dts1[0].linguan:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # dts2 = Tiangan.select().where(Tiangan.name == bazi.yueGan.text)
|
|
|
+ # if len(dts2) > 0:
|
|
|
+ # if bazi.yueZhi.text == dts2[0].linguan:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # dts3 = Tiangan.select().where(Tiangan.name == bazi.riGan.text)
|
|
|
+ # if len(dts3) > 0:
|
|
|
+ # if bazi.riZhi.text == dts3[0].linguan:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # dts4 = Tiangan.select().where(Tiangan.name == bazi.shiGan.text)
|
|
|
+ # if len(dts4) > 0:
|
|
|
+ # if bazi.shiZhi.text == dts4[0].linguan:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_kuigang(bazi: BaZi):
|
|
|
key = "魁罡"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- if bazi.nianGan.text == "庚" and bazi.nianZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.nianGan.text == "庚" and bazi.nianZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.nianGan.text == "戊" and bazi.nianZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.nianGan.text == "壬" and bazi.nianZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
-
|
|
|
- if bazi.yueGan.text == "庚" and bazi.yueZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.yueGan.text == "庚" and bazi.yueZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.yueGan.text == "戊" and bazi.yueZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.yueGan.text == "壬" and bazi.yueZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
-
|
|
|
- if bazi.riGan.text == "庚" and bazi.riZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- if bazi.riGan.text == "庚" and bazi.riZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- if bazi.riGan.text == "戊" and bazi.riZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- if bazi.riGan.text == "壬" and bazi.riZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
-
|
|
|
- if bazi.shiGan.text == "庚" and bazi.shiZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
- if bazi.shiGan.text == "庚" and bazi.shiZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
- if bazi.shiGan.text == "戊" and bazi.shiZhi.text == "戌":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
- if bazi.shiGan.text == "壬" and bazi.shiZhi.text == "辰":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # if bazi.nianGan.text == "庚" and bazi.nianZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.nianGan.text == "庚" and bazi.nianZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.nianGan.text == "戊" and bazi.nianZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.nianGan.text == "壬" and bazi.nianZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ #
|
|
|
+ # if bazi.yueGan.text == "庚" and bazi.yueZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.yueGan.text == "庚" and bazi.yueZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.yueGan.text == "戊" and bazi.yueZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.yueGan.text == "壬" and bazi.yueZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ #
|
|
|
+ # if bazi.riGan.text == "庚" and bazi.riZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # if bazi.riGan.text == "庚" and bazi.riZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # if bazi.riGan.text == "戊" and bazi.riZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # if bazi.riGan.text == "壬" and bazi.riZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ #
|
|
|
+ # if bazi.shiGan.text == "庚" and bazi.shiZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # if bazi.shiGan.text == "庚" and bazi.shiZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # if bazi.shiGan.text == "戊" and bazi.shiZhi.text == "戌":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # if bazi.shiGan.text == "壬" and bazi.shiZhi.text == "辰":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_dashe(bazi: BaZi):
|
|
|
key = "大赦"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- dts = Dashe.select().where(Dashe.rigan == bazi.riGan.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if bazi.nianGan.text == dts[0].tiangan and bazi.nianZhi.text == dts[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.yueGan.text == dts[0].tiangan and bazi.yueZhi.text == dts[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.shiGan.text == dts[0].tiangan and bazi.shiZhi.text == dts[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # dts = Dashe.select().where(Dashe.rigan == bazi.riGan.text)
|
|
|
+ # if len(dts) > 0:
|
|
|
+ # if bazi.nianGan.text == dts[0].tiangan and bazi.nianZhi.text == dts[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.yueGan.text == dts[0].tiangan and bazi.yueZhi.text == dts[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.shiGan.text == dts[0].tiangan and bazi.shiZhi.text == dts[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_yima(bazi: BaZi):
|
|
|
key = "驿马"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- dts1 = Yima.select().where(Yima.dizhi == bazi.nianZhi.text)
|
|
|
- if len(dts1) > 0:
|
|
|
- if bazi.yueZhi.text == dts1[0].chong:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.riZhi.text == dts1[0].chong:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- if bazi.shiZhi.text == dts1[0].chong:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
- dts2 = Yima.select().where(Yima.dizhi == bazi.riZhi.text)
|
|
|
- if len(dts2) > 0:
|
|
|
- if bazi.nianZhi.text == dts2[0].chong:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.yueZhi.text == dts2[0].chong:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.shiZhi.text == dts2[0].chong:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # dts1 = Yima.select().where(Yima.dizhi == bazi.nianZhi.text)
|
|
|
+ # if len(dts1) > 0:
|
|
|
+ # if bazi.yueZhi.text == dts1[0].chong:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.riZhi.text == dts1[0].chong:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # if bazi.shiZhi.text == dts1[0].chong:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # dts2 = Yima.select().where(Yima.dizhi == bazi.riZhi.text)
|
|
|
+ # if len(dts2) > 0:
|
|
|
+ # if bazi.nianZhi.text == dts2[0].chong:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.yueZhi.text == dts2[0].chong:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.shiZhi.text == dts2[0].chong:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_jiangxing(bazi: BaZi):
|
|
|
key = "将星"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- ary = ["子", "午", "卯", "酉"]
|
|
|
- if ary.__contains__(bazi.nianZhi.text):
|
|
|
- wz = SiZhuWeiZhi.nianzhu
|
|
|
- dz = SiZhuWeiZhi.nianzhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
- if ary.__contains__(bazi.yueZhi.text):
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- dz = SiZhuWeiZhi.yuezhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
- if ary.__contains__(bazi.riZhi.text):
|
|
|
- wz = SiZhuWeiZhi.rizhu
|
|
|
- dz = SiZhuWeiZhi.rizhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
- if ary.__contains__(bazi.shiZhi.text):
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- dz = SiZhuWeiZhi.shizhi
|
|
|
- bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # ary = ["子", "午", "卯", "酉"]
|
|
|
+ # if ary.__contains__(bazi.nianZhi.text):
|
|
|
+ # wz = SiZhuWeiZhi.nianzhu
|
|
|
+ # dz = SiZhuWeiZhi.nianzhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
+ # if ary.__contains__(bazi.yueZhi.text):
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # dz = SiZhuWeiZhi.yuezhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
+ # if ary.__contains__(bazi.riZhi.text):
|
|
|
+ # wz = SiZhuWeiZhi.rizhu
|
|
|
+ # dz = SiZhuWeiZhi.rizhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
+ # if ary.__contains__(bazi.shiZhi.text):
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # dz = SiZhuWeiZhi.shizhi
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_jiangxing_effect(bazi, dz))
|
|
|
|
|
|
|
|
|
def __check_yangren(bazi: BaZi):
|
|
|
key = "羊刃"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- if bazi.nianZhi.shiShen == "劫":
|
|
|
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.nianZhi.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if dts[0].zhangsheng == "帝":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
-
|
|
|
- if bazi.yueZhi.shiShen == "劫":
|
|
|
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.yueZhi.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if dts[0].zhangsheng == "帝":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
-
|
|
|
- if bazi.riZhi.shiShen == "劫":
|
|
|
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.riZhi.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if dts[0].zhangsheng == "帝":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
-
|
|
|
- if bazi.shiZhi.shiShen == "劫":
|
|
|
- dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.shiZhi.text)
|
|
|
- if len(dts) > 0:
|
|
|
- if dts[0].zhangsheng == "帝":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # if bazi.nianZhi.shiShen == "劫":
|
|
|
+ # # dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.nianZhi.text)
|
|
|
+ # # if len(dts) > 0:
|
|
|
+ # # if dts[0].zhangsheng == "帝":
|
|
|
+ # # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # pass
|
|
|
+ #
|
|
|
+ # if bazi.yueZhi.shiShen == "劫":
|
|
|
+ # # dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.yueZhi.text)
|
|
|
+ # # if len(dts) > 0:
|
|
|
+ # # if dts[0].zhangsheng == "帝":
|
|
|
+ # # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # pass
|
|
|
+ #
|
|
|
+ # if bazi.riZhi.shiShen == "劫":
|
|
|
+ # # dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.riZhi.text)
|
|
|
+ # # if len(dts) > 0:
|
|
|
+ # # if dts[0].zhangsheng == "帝":
|
|
|
+ # # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # pass
|
|
|
+ #
|
|
|
+ # if bazi.shiZhi.shiShen == "劫":
|
|
|
+ # # dts = Zhangsheng.select().where(Zhangsheng.tiangan == bazi.riGan.text, Zhangsheng.dizhi == bazi.shiZhi.text)
|
|
|
+ # # if len(dts) > 0:
|
|
|
+ # # if dts[0].zhangsheng == "帝":
|
|
|
+ # # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # pass
|
|
|
|
|
|
|
|
|
def __check_diwang(bazi: BaZi):
|
|
|
key = "地网"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- if bazi.nianZhi.text == "辰" or bazi.nianZhi.text == "戌":
|
|
|
- if bazi.yueZhi.text == "巳" or bazi.yueZhi.text == "亥":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.riZhi.text == "巳" or bazi.riZhi.text == "亥":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- if bazi.shiZhi.text == "巳" or bazi.shiZhi.text == "亥":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
- if bazi.riZhi.text == "辰" or bazi.riZhi.text == "戌":
|
|
|
- if bazi.nianZhi.text == "巳" or bazi.nianZhi.text == "亥":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.yueZhi.text == "巳" or bazi.yueZhi.text == "亥":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.shiZhi.text == "巳" or bazi.shiZhi.text == "亥":
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # if bazi.nianZhi.text == "辰" or bazi.nianZhi.text == "戌":
|
|
|
+ # if bazi.yueZhi.text == "巳" or bazi.yueZhi.text == "亥":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.riZhi.text == "巳" or bazi.riZhi.text == "亥":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # if bazi.shiZhi.text == "巳" or bazi.shiZhi.text == "亥":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # if bazi.riZhi.text == "辰" or bazi.riZhi.text == "戌":
|
|
|
+ # if bazi.nianZhi.text == "巳" or bazi.nianZhi.text == "亥":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.yueZhi.text == "巳" or bazi.yueZhi.text == "亥":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.shiZhi.text == "巳" or bazi.shiZhi.text == "亥":
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_huagai(bazi: BaZi):
|
|
|
key = "华盖"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- dt1 = Huagai.select().where(Huagai.nianzhi == bazi.nianZhi.text)
|
|
|
- if len(dt1) > 0:
|
|
|
- if bazi.yueZhi.text == dt1[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.riZhi.text == dt1[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
- if bazi.shiZhi.text == dt1[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
- dt2 = Huagai.select().where(Huagai.rizhi == bazi.riZhi.text)
|
|
|
- if len(dt2) > 0:
|
|
|
- if bazi.nianZhi.text == dt2[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
- if bazi.yueZhi.text == dt2[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
- if bazi.shiZhi.text == dt2[0].dizhi:
|
|
|
- bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # dt1 = Huagai.select().where(Huagai.nianzhi == bazi.nianZhi.text)
|
|
|
+ # if len(dt1) > 0:
|
|
|
+ # if bazi.yueZhi.text == dt1[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.riZhi.text == dt1[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.rizhu, key, tip)
|
|
|
+ # if bazi.shiZhi.text == dt1[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
+ # dt2 = Huagai.select().where(Huagai.rizhi == bazi.riZhi.text)
|
|
|
+ # if len(dt2) > 0:
|
|
|
+ # if bazi.nianZhi.text == dt2[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.nianzhu, key, tip)
|
|
|
+ # if bazi.yueZhi.text == dt2[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.yuezhu, key, tip)
|
|
|
+ # if bazi.shiZhi.text == dt2[0].dizhi:
|
|
|
+ # bazi.add_shensha(SiZhuWeiZhi.shizhu, key, tip)
|
|
|
|
|
|
|
|
|
def __check_taohua(bazi: BaZi):
|
|
|
key = "桃花"
|
|
|
- tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
- dts1 = Taohua.select().where(Taohua.nianzhi == bazi.nianZhi.text)
|
|
|
- if len(dts1) > 0:
|
|
|
- if bazi.yueZhi.text == dts1[0].dizhi:
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- dz = SiZhuWeiZhi.yuezhi
|
|
|
- zhu = bazi.yueZhi
|
|
|
- gan = bazi.yueGan
|
|
|
- zhuStr = "月柱"
|
|
|
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
- if bazi.riZhi.text == dts1[0].dizhi:
|
|
|
- wz = SiZhuWeiZhi.rizhu
|
|
|
- dz = SiZhuWeiZhi.rizhi
|
|
|
- zhu = bazi.riZhi
|
|
|
- gan = bazi.riGan
|
|
|
- zhuStr = "日柱"
|
|
|
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
- if bazi.shiZhi.text == dts1[0].dizhi:
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- dz = SiZhuWeiZhi.shizhi
|
|
|
- zhu = bazi.shiZhi
|
|
|
- gan = bazi.shiGan
|
|
|
- zhuStr = "时柱"
|
|
|
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
-
|
|
|
- dts2 = Taohua.select().where(Taohua.rizhi == bazi.riZhi.text)
|
|
|
- if len(dts2) > 0:
|
|
|
- if bazi.nianZhi.text == dts2[0].dizhi:
|
|
|
- wz = SiZhuWeiZhi.nianzhu
|
|
|
- dz = SiZhuWeiZhi.nianzhi
|
|
|
- zhu = bazi.nianZhi
|
|
|
- gan = bazi.nianGan
|
|
|
- zhuStr = "年柱"
|
|
|
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
- if bazi.yueZhi.text == dts2[0].dizhi:
|
|
|
- wz = SiZhuWeiZhi.yuezhu
|
|
|
- dz = SiZhuWeiZhi.yuezhi
|
|
|
- zhu = bazi.yueZhi
|
|
|
- gan = bazi.yueGan
|
|
|
- zhuStr = "月柱"
|
|
|
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
- if bazi.shiZhi.text == dts2[0].dizhi:
|
|
|
- wz = SiZhuWeiZhi.shizhu
|
|
|
- dz = SiZhuWeiZhi.shizhi
|
|
|
- zhu = bazi.shiZhi
|
|
|
- gan = bazi.shiGan
|
|
|
- zhuStr = "时柱"
|
|
|
- bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
+ # tip = ShenshaTips.select().where(ShenshaTips.shensha == key)[0].tips
|
|
|
+ # dts1 = Taohua.select().where(Taohua.nianzhi == bazi.nianZhi.text)
|
|
|
+ # if len(dts1) > 0:
|
|
|
+ # if bazi.yueZhi.text == dts1[0].dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # dz = SiZhuWeiZhi.yuezhi
|
|
|
+ # zhu = bazi.yueZhi
|
|
|
+ # gan = bazi.yueGan
|
|
|
+ # zhuStr = "月柱"
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
+ # if bazi.riZhi.text == dts1[0].dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.rizhu
|
|
|
+ # dz = SiZhuWeiZhi.rizhi
|
|
|
+ # zhu = bazi.riZhi
|
|
|
+ # gan = bazi.riGan
|
|
|
+ # zhuStr = "日柱"
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
+ # if bazi.shiZhi.text == dts1[0].dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # dz = SiZhuWeiZhi.shizhi
|
|
|
+ # zhu = bazi.shiZhi
|
|
|
+ # gan = bazi.shiGan
|
|
|
+ # zhuStr = "时柱"
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
+ #
|
|
|
+ # dts2 = Taohua.select().where(Taohua.rizhi == bazi.riZhi.text)
|
|
|
+ # if len(dts2) > 0:
|
|
|
+ # if bazi.nianZhi.text == dts2[0].dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.nianzhu
|
|
|
+ # dz = SiZhuWeiZhi.nianzhi
|
|
|
+ # zhu = bazi.nianZhi
|
|
|
+ # gan = bazi.nianGan
|
|
|
+ # zhuStr = "年柱"
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
+ # if bazi.yueZhi.text == dts2[0].dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.yuezhu
|
|
|
+ # dz = SiZhuWeiZhi.yuezhi
|
|
|
+ # zhu = bazi.yueZhi
|
|
|
+ # gan = bazi.yueGan
|
|
|
+ # zhuStr = "月柱"
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
+ # if bazi.shiZhi.text == dts2[0].dizhi:
|
|
|
+ # wz = SiZhuWeiZhi.shizhu
|
|
|
+ # dz = SiZhuWeiZhi.shizhi
|
|
|
+ # zhu = bazi.shiZhi
|
|
|
+ # gan = bazi.shiGan
|
|
|
+ # zhuStr = "时柱"
|
|
|
+ # bazi.add_shensha(wz, key, tip, __get_taohua_effect(bazi, zhu, gan, wz, dz, zhuStr))
|
|
|
|
|
|
|
|
|
def __get_jiangxing_effect(bazi: BaZi, wz: SiZhuWeiZhi):
|