| | |
| | | import { UserInfoEntity } from '../entity/info'; |
| | | import { UserSmsService } from './sms'; |
| | | import { UserWxService } from './wx'; |
| | | import { RecycleOrderEntity } from '../../shop/entity/recycleorder'; |
| | | |
| | | |
| | | /** |
| | | * 用户信息 |
| | |
| | | export class UserInfoService extends BaseService { |
| | | @InjectEntityModel(UserInfoEntity) |
| | | userInfoEntity: Repository<UserInfoEntity>; |
| | | |
| | | @InjectEntityModel(RecycleOrderEntity) |
| | | recycleOrderEntity: Repository<RecycleOrderEntity>; |
| | | |
| | | @Inject() |
| | | pluginService: PluginService; |
| | |
| | | uuid() + '.png' |
| | | ); |
| | | } |
| | | } catch (err) {} |
| | | } catch (err) { } |
| | | try { |
| | | return await this.userInfoEntity.update({ id }, param); |
| | | } catch (err) { |
| | |
| | | } |
| | | await this.userInfoEntity.update({ id: userId }, { phone }); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户的碳积分信息 |
| | | * @param unionid |
| | | */ |
| | | async dashboard(unionid) { |
| | | const info = await this.userInfoEntity.findOneBy({ unionid: unionid }); |
| | | if (!info) { |
| | | throw new CoolCommException('查询无结果'); |
| | | } |
| | | |
| | | const count_ = await this.recycleOrderEntity.countBy({ |
| | | campusUserId: unionid |
| | | }); |
| | | |
| | | |
| | | return { carbonPoints: info.carbonBalance, recycleCount:count_, overPercent: 90 } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |