UserBalanceLog.php 552 B

123456789101112131415161718192021
  1. <?php
  2. namespace app\weixin\model;
  3. use think\Model;
  4. class UserBalanceLog extends Model
  5. {
  6. protected $table = 'sg_user_balance_log';
  7. /**
  8. * 验证用户是否已经结算过对应类型收益
  9. * @param $userid 结算用户ID
  10. * @param $sourceUid 来源用户ID
  11. * @param $type 收益类型
  12. * @return mixed
  13. */
  14. public static function checkHasMarket($userid, $sourceUid, $type){
  15. return UserBalanceLog::where(['user_id'=> $userid, 'source_uid'=> $sourceUid,'type'=> $type, 'status'=> 1])->value('id');
  16. }
  17. }