完整版V1 加入爬虫功能
This commit is contained in:
@@ -98,7 +98,8 @@ class Ticket extends Model
|
||||
*/
|
||||
public function splitLink()
|
||||
{
|
||||
return $this->belongsTo(Link::class, 'split_link_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
// IN 预载入:避免 eagerlyType=0(JOIN) 与列表 field 子查询冲突导致 SQL 1064
|
||||
return $this->belongsTo(Link::class, 'split_link_id', 'id', [], 'LEFT')->setEagerlyType(1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,7 +127,7 @@ class Ticket extends Model
|
||||
$total = (int) ($data['ticket_total'] ?? 0);
|
||||
$complete = (int) ($data['complete_count'] ?? 0);
|
||||
if ($total <= 0) {
|
||||
return '—';
|
||||
return '0%';
|
||||
}
|
||||
$percent = round($complete / $total * 100, 2);
|
||||
return $percent . '%';
|
||||
|
||||
Reference in New Issue
Block a user