forked from Catfeeds/ssrpanel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
309 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Components; | ||
|
||
use ipip\db\Reader; | ||
|
||
class IPIP | ||
{ | ||
/** | ||
* 查询IP地址的详细信息 | ||
* | ||
* @param string $ip IPv4 | ||
* | ||
* @return \ipip\db\Info|null | ||
* @throws \Exception | ||
*/ | ||
public function ip($ip) | ||
{ | ||
$filePath = storage_path('ipip.ipdb'); | ||
|
||
$db = new Reader($filePath); | ||
//$loc = $db->find($ip); | ||
//$loc = $db->findMap($ip); | ||
$loc = $db->findInfo($ip); | ||
|
||
return $loc; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Http\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* 用户流量变动记录 | ||
* Class UserTrafficModifyLog | ||
* | ||
* @package App\Http\Models | ||
*/ | ||
class UserTrafficModifyLog extends Model | ||
{ | ||
protected $table = 'user_traffic_modify_log'; | ||
protected $primaryKey = 'id'; | ||
|
||
// 关联账号 | ||
public function User() | ||
{ | ||
return $this->hasOne(User::class, 'id', 'user_id'); | ||
} | ||
|
||
// 关联订单 | ||
public function Order() | ||
{ | ||
return $this->hasOne(Order::class, 'oid', 'order_id'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.