end_time)-time(); if($v>=0){ return $v; } return 0; } /** * 一对多关联表 */ public function help(){ return $this->hasMany('GroupBuyHelp', 'join_id')->where('pay_state','in',[0,1]) ->where('has_canceled',0) ->order('id', 'asc'); } public function getHcCountAttr(){ $v = $this->people_count - $this->help_count; if($v>=0){ return $v; } return 0; } /** * 关联用户表 * @return \think\model\relation\BelongsTo */ public function user(){ $module = self::getCalledModule(); return $this->belongsTo("app\\{$module}\\model\\User"); } private function addVirJoin($join_id,$user,$source=0){ } }