Просмотр исходного кода

处理下级收益查询的项目不对

liaoyongfei лет назад: 4
Родитель
Сommit
20bea322a3

+ 2 - 2
ymall/src/main/java/com/liangjian11/ymall/service/impl/UserRoleServiceImpl.java

@@ -45,8 +45,8 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
     List<UserRole> list = userRoleMapper.selectList(userRoleQuery);
 
     Doctor doctor = null;
+    QueryWrapper<Doctor> doctorQuery = new QueryWrapper<>();
     if (StringUtils.isNotBlank(account.getMobile())) {
-      QueryWrapper<Doctor> doctorQuery = new QueryWrapper<>();
       doctorQuery.eq("phone", account.getMobile());
       doctor = doctorService.getOne(doctorQuery);
     }
@@ -135,7 +135,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
         doctor.setAccountID(account.getId());
         doctor.setUnionid(account.getUnionid());
         doctor.setWxOpenID(account.getWxopenid());
-        doctorService.updateById(doctor);
+        doctorService.update(doctor,doctorQuery);
         if (StringUtils.isNotBlank(id)) {
           QueryWrapper<PartnerRecommend> partnerRecommendQuery = new QueryWrapper<>();
           partnerRecommendQuery.eq("subordinate_id", doctor.getId());

+ 3 - 1
ymall/src/main/resources/mapper/CalculationProfitMapper.xml

@@ -222,7 +222,9 @@
   <select id="getProfitDetailOfSubordinateIncomeById" resultMap="baseMap">
     select a.* ,b.user_role_name as "interrogatorName" ,
     c.calculation_explain as "calculationExplain"
-    from calculation_profit as a join user_role as b on a.user_role_id=b.user_role_id
+    from calculation_profit as a
+    join calculation_profit as d ON a.subordinate_calculation_id=d.id
+    join user_role as b on d.user_role_id=b.user_role_id
     join profit_rule_detail as c on a.profit_rule_detail_id=c.id
     where a.id=#{id}  and a.type=3
   </select>