first commit
This commit is contained in:
28
app/Models/AccountLevelMoney.php
Normal file
28
app/Models/AccountLevelMoney.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class AccountLevelMoney extends Model
|
||||
{
|
||||
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "account_level_money";
|
||||
protected $fillable = [
|
||||
'sdt',
|
||||
'type',
|
||||
'min',
|
||||
'max',
|
||||
];
|
||||
|
||||
public function getGameAttribute()
|
||||
{
|
||||
$games = Config::get('constant.list_game');
|
||||
return $games[$this->type] ?? '';
|
||||
}
|
||||
|
||||
}
|
79
app/Models/AccountMomo.php
Normal file
79
app/Models/AccountMomo.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AccountMomo extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'sdt',
|
||||
'password',
|
||||
'token',
|
||||
'status',
|
||||
'gioihan',
|
||||
'webapi'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'token',
|
||||
];
|
||||
|
||||
public function TextStatus($status){
|
||||
|
||||
if ($status == 1) {
|
||||
return 'Hoạt động';
|
||||
}
|
||||
|
||||
if ($status == 2) {
|
||||
return 'Đang bảo trì';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function ClassStatus($status){
|
||||
|
||||
if ($status == 1) {
|
||||
return 'success';
|
||||
}
|
||||
|
||||
if ($status == 2) {
|
||||
return 'danger';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function GetListAccountID($id){
|
||||
$id='';
|
||||
$AccountMomo = new AccountMomo;
|
||||
$ListAccount = $AccountMomo->get();
|
||||
foreach ($ListAccount as $row) {
|
||||
$id=$id .$row->id.',';
|
||||
}
|
||||
$list_id = explode(',', $id);
|
||||
|
||||
$data = [];
|
||||
$dem = 0;
|
||||
|
||||
foreach($list_id as $row){
|
||||
$res = $this->where([
|
||||
'id' => $row,
|
||||
'status' => 1,
|
||||
]);
|
||||
|
||||
if ($res->count() > 0) {
|
||||
$response = $res->first()->sdt;
|
||||
$data[$dem] = $response;
|
||||
$dem++;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
19
app/Models/AttendanceDateSetting.php
Normal file
19
app/Models/AttendanceDateSetting.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class AttendanceDateSetting extends Model
|
||||
{
|
||||
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = "attendance_date_setting";
|
||||
protected $fillable = [
|
||||
'mocchoi',
|
||||
'tiennhan',
|
||||
];
|
||||
}
|
43
app/Models/AttendanceSession.php
Normal file
43
app/Models/AttendanceSession.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AttendanceSession extends Model
|
||||
{
|
||||
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "attendance_session";
|
||||
protected $fillable = [
|
||||
'phone',
|
||||
'date',
|
||||
'amount',
|
||||
'bill_code',
|
||||
'status',
|
||||
];
|
||||
|
||||
public function getPhone()
|
||||
{
|
||||
$middle_string = "";
|
||||
$length = strlen($this->phone);
|
||||
if ($length < 3) {
|
||||
return $length == 1 ? "*" : "*".substr($this->phone, -1);
|
||||
} else {
|
||||
$part_size = floor($length / 3);
|
||||
$middle_part_size = $length - ($part_size * 2);
|
||||
for ($i = 0; $i < $middle_part_size; $i++) {
|
||||
$middle_string .= "*";
|
||||
}
|
||||
return substr($this->phone, 0, $part_size).$middle_string.substr($this->phone, -$part_size);
|
||||
}
|
||||
}
|
||||
|
||||
public function usersAttendanceSession()
|
||||
{
|
||||
return $this->hasMany(UserAttendanceSession::class, 'session_id');
|
||||
}
|
||||
|
||||
}
|
22
app/Models/AttendanceSetting.php
Normal file
22
app/Models/AttendanceSetting.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AttendanceSetting extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table ="attendance_settings";
|
||||
protected $fillable = [
|
||||
'win_rate',
|
||||
'bot_rate',
|
||||
'start_time',
|
||||
'end_time',
|
||||
'money_min',
|
||||
'money_max',
|
||||
'time_each',
|
||||
'setphonewin'
|
||||
];
|
||||
}
|
11
app/Models/Cache.php
Normal file
11
app/Models/Cache.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Cache extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
18
app/Models/ChanLe.php
Normal file
18
app/Models/ChanLe.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ChanLe extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'min',
|
||||
'max',
|
||||
'sdt',
|
||||
'tile'
|
||||
];
|
||||
}
|
11
app/Models/ChanLe2.php
Normal file
11
app/Models/ChanLe2.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ChanLe2 extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
15
app/Models/ConfigMessageMomo.php
Normal file
15
app/Models/ConfigMessageMomo.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ConfigMessageMomo extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
|
||||
];
|
||||
}
|
20
app/Models/Gap3.php
Normal file
20
app/Models/Gap3.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Gap3 extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'min',
|
||||
'max',
|
||||
'sdt',
|
||||
'tile1',
|
||||
'tile2',
|
||||
'tile3'
|
||||
];
|
||||
}
|
11
app/Models/LichSuBank.php
Normal file
11
app/Models/LichSuBank.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LichSuBank extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
12
app/Models/LichSuChoiAttendanceDate.php
Normal file
12
app/Models/LichSuChoiAttendanceDate.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LichSuChoiAttendanceDate extends Model
|
||||
{
|
||||
protected $table = "lich_su_attendance_date";
|
||||
use HasFactory;
|
||||
}
|
27
app/Models/LichSuChoiMomo.php
Normal file
27
app/Models/LichSuChoiMomo.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LichSuChoiMomo extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function getSdtHiddenAttribute()
|
||||
{
|
||||
$middle_string = "";
|
||||
$length = strlen($this->sdt);
|
||||
if ($length < 3) {
|
||||
return $length == 1 ? "*" : "*".substr($this->sdt, -1);
|
||||
} else {
|
||||
$part_size = floor($length / 3);
|
||||
$middle_part_size = $length - ($part_size * 2);
|
||||
for ($i = 0; $i < $middle_part_size; $i++) {
|
||||
$middle_string .= "*";
|
||||
}
|
||||
return substr($this->sdt, 0, $part_size).$middle_string.substr($this->sdt, -$part_size);
|
||||
}
|
||||
}
|
||||
}
|
11
app/Models/LichSuChoiNoHu.php
Normal file
11
app/Models/LichSuChoiNoHu.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LichSuChoiNoHu extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
11
app/Models/LichSuTraThuongTuan.php
Normal file
11
app/Models/LichSuTraThuongTuan.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LichSuTraThuongTuan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
11
app/Models/LimitCron.php
Normal file
11
app/Models/LimitCron.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LimitCron extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
12
app/Models/MaGiaoDich.php
Normal file
12
app/Models/MaGiaoDich.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MaGiaoDich extends Model
|
||||
{
|
||||
protected $table = "ma_giao_dichs";
|
||||
use HasFactory;
|
||||
}
|
17
app/Models/NoHuu.php
Normal file
17
app/Models/NoHuu.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class NoHuu extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'tiencuoc',
|
||||
'tienmacdinh',
|
||||
'ptvaohu',
|
||||
];
|
||||
}
|
35
app/Models/Setting.php
Normal file
35
app/Models/Setting.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Setting extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'description',
|
||||
'logo',
|
||||
'linkvideoyoutube',
|
||||
'zalo',
|
||||
'baotri',
|
||||
'script',
|
||||
'color_header',
|
||||
'color_footer',
|
||||
'color_table',
|
||||
'color_table2',
|
||||
'on_chanle',
|
||||
'on_taixiu',
|
||||
'on_chanle2',
|
||||
'on_gap3',
|
||||
'on_tong3so',
|
||||
'on_1phan3',
|
||||
'on_nohu',
|
||||
'on_trathuongtuan',
|
||||
'on_diemdanh',
|
||||
'on_diemdanh_ngay'
|
||||
];
|
||||
}
|
11
app/Models/SettingPhanThuongTop.php
Normal file
11
app/Models/SettingPhanThuongTop.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SettingPhanThuongTop extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
18
app/Models/TaiXiu.php
Normal file
18
app/Models/TaiXiu.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TaiXiu extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'min',
|
||||
'max',
|
||||
'sdt',
|
||||
'tile'
|
||||
];
|
||||
}
|
11
app/Models/Tong3So.php
Normal file
11
app/Models/Tong3So.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Tong3So extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
12
app/Models/TopTuan.php
Normal file
12
app/Models/TopTuan.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TopTuan extends Model
|
||||
{
|
||||
protected $table = "top_tuan";
|
||||
use HasFactory;
|
||||
}
|
43
app/Models/User.php
Normal file
43
app/Models/User.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
}
|
34
app/Models/UserAttendanceSession.php
Normal file
34
app/Models/UserAttendanceSession.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserAttendanceSession extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = "users_attendance_session";
|
||||
protected $fillable = [
|
||||
'session_id',
|
||||
'user_id',
|
||||
'phone',
|
||||
'status',
|
||||
];
|
||||
public function getPhone()
|
||||
{
|
||||
$middle_string = "";
|
||||
$length = strlen($this->phone);
|
||||
if ($length < 3) {
|
||||
return $length == 1 ? "*" : "*".substr($this->phone, -1);
|
||||
} else {
|
||||
$part_size = floor($length / 3);
|
||||
$middle_part_size = $length - ($part_size * 2);
|
||||
for ($i = 0; $i < $middle_part_size; $i++) {
|
||||
$middle_string .= "*";
|
||||
}
|
||||
return substr($this->phone, 0, $part_size).$middle_string.substr($this->phone, -$part_size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
128
app/Models/WEB2M.php
Normal file
128
app/Models/WEB2M.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Models\AccountMomo;
|
||||
use App\Models\LichSuBank;
|
||||
|
||||
class WEB2M extends AccountMomo
|
||||
{
|
||||
//Lấy lịch sử giao dịch
|
||||
public function GetGiaoDich($token,$webapi){
|
||||
if($webapi == 1 ){
|
||||
$url = "https://nguyenkhoa.dichvuapi.com/historyapimomo1h/$token";
|
||||
}
|
||||
else{
|
||||
//$url = "https://thueapimomo.vn/HISTORYAPIMOMOVIP?token=$token&time=1";https://apiv3.web2m.com
|
||||
$url = "https://apiv3.web2m.com/historyapimomo1h/$token";
|
||||
}
|
||||
|
||||
$response = Http::get($url);
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
|
||||
//Chuyển tiền MOMO
|
||||
public function Bank($token, $sdtnguoinhan, $password, $money, $noidung,$webapi){
|
||||
//$url = "https://api.web2m.com/TRANSFERAPIMOMO/$token/$sdtnguoinhan/$password/$money/$noidung";
|
||||
|
||||
if($webapi == 1 ){
|
||||
$url = "https://nguyenkhoa.dichvuapi.com/TRANSFERAPIMOMO/$token/$sdtnguoinhan/$password/$money/$noidung";
|
||||
}
|
||||
else{
|
||||
//$url = "https://thueapimomo.vn/TRANSFERAPIMOMO?token=$token&phone=$sdtnguoinhan&cash=$money&comment=$noidung&passmomo=$password";
|
||||
$url = "https://apiv3.web2m.com/TRANSFERAPIMOMO/$token/$sdtnguoinhan/$password/$money/$noidung";
|
||||
}
|
||||
|
||||
$response = Http::get($url);
|
||||
|
||||
$AccountMomo = new AccountMomo;
|
||||
$getInfoPhone = $AccountMomo->where([
|
||||
'token' => $token
|
||||
])->first();
|
||||
|
||||
$LichSuBank = new LichSuBank;
|
||||
$LichSuBank->sdtbank = $getInfoPhone->sdt;
|
||||
$LichSuBank->nguoinhan = $sdtnguoinhan;
|
||||
$LichSuBank->sotien = $money;
|
||||
$LichSuBank->noidung = $noidung;
|
||||
$LichSuBank->response = json_encode($response->json() ?? []);
|
||||
$LichSuBank->save();
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
|
||||
public function getMoney_momo($token,$webapi)
|
||||
{
|
||||
try {
|
||||
//$result = Http::get("https://api.web2m.com/apigetsodu/$token")->json();
|
||||
if($webapi == 1 ){
|
||||
$result = Http::get("https://nguyenkhoa.dichvuapi.com/apigetsodu/$token")->json();
|
||||
}
|
||||
else{
|
||||
//$result = Http::get("https://thueapimomo.vn/GETBALANCEAPIMOMO?token=$token")->json();
|
||||
$result = Http::get("https://apiv3.web2m.com/apigetsodu/$token")->json();
|
||||
}
|
||||
|
||||
|
||||
//if($webapi == 1 ){
|
||||
if(true){
|
||||
if(isset($result['status']) && $result['status'] == 200){
|
||||
return $result['SoDu'];
|
||||
}else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
if(isset($result['status']) && $result['status'] == 'success'){
|
||||
return $result['balance'];
|
||||
}else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
catch(Exception $e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function getName_momo($sdt, $token, $webapi)
|
||||
{
|
||||
try {
|
||||
//$result = Http::get("https://api.web2m.com/apigetten/".$sdt."/".$token)->json();
|
||||
if($webapi == 1 ){
|
||||
$result = Http::get("https://nguyenkhoa.dichvuapi.com/apigetten/".$sdt."/".$token)->json();
|
||||
}
|
||||
else{
|
||||
$result = Http::get("https://apiv3.web2m.com/apigetten/".$sdt."/".$token)->json();
|
||||
// $result = Http::get("https://thueapimomo.vn/GETNAMEAPIMOMO?token=$token&phone=$sdt")->json();
|
||||
}
|
||||
if(isset($result['status']) && $result['status'] == 200)
|
||||
{
|
||||
return $result['name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !empty($result['msg']) ){
|
||||
return $result['msg'];
|
||||
} else {
|
||||
return 'Có lỗi xãy ra vui lòng F5';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception $e) {
|
||||
return 'Có lỗi xãy ra vui lòng thử lại';
|
||||
}
|
||||
}
|
||||
}
|
85
app/Models/WEB2Mbk.php
Normal file
85
app/Models/WEB2Mbk.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Models\AccountMomo;
|
||||
use App\Models\LichSuBank;
|
||||
|
||||
class WEB2M extends AccountMomo
|
||||
{
|
||||
//Lấy lịch sử giao dịch
|
||||
public function GetGiaoDich($token){
|
||||
$url = "https://api.web2m.com/historyapimomo1h/$token";
|
||||
$response = Http::get($url);
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
|
||||
//Chuyển tiền MOMO
|
||||
public function Bank($token, $sdtnguoinhan, $password, $money, $noidung){
|
||||
$url = "https://api.web2m.com/TRANSFERAPIMOMO/$token/$sdtnguoinhan/$password/$money/$noidung";
|
||||
$response = Http::get($url);
|
||||
|
||||
$AccountMomo = new AccountMomo;
|
||||
$getInfoPhone = $AccountMomo->where([
|
||||
'token' => $token
|
||||
])->first();
|
||||
|
||||
$LichSuBank = new LichSuBank;
|
||||
$LichSuBank->sdtbank = $getInfoPhone->sdt;
|
||||
$LichSuBank->nguoinhan = $sdtnguoinhan;
|
||||
$LichSuBank->sotien = $money;
|
||||
$LichSuBank->noidung = $noidung;
|
||||
$LichSuBank->response = json_encode($response->json() ?? []);
|
||||
$LichSuBank->save();
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
|
||||
public function getMoney_momo($token)
|
||||
{
|
||||
try {
|
||||
$result = Http::get("https://api.web2m.com/apigetsodu/$token")->json();
|
||||
|
||||
if(isset($result['status']) && $result['status'] == 200)
|
||||
{
|
||||
return $result['SoDu'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception $e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function getName_momo($sdt, $token)
|
||||
{
|
||||
try {
|
||||
$result = Http::get("https://api.web2m.com/apigetten/".$sdt."/".$token)->json();
|
||||
|
||||
if(isset($result['status']) && $result['status'] == 200)
|
||||
{
|
||||
return $result['name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !empty($result['msg']) ){
|
||||
return $result['msg'];
|
||||
} else {
|
||||
return 'Có lỗi xãy ra vui lòng F5';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception $e) {
|
||||
return 'Có lỗi xãy ra vui lòng thử lại';
|
||||
}
|
||||
}
|
||||
}
|
11
app/Models/X1Phan3.php
Normal file
11
app/Models/X1Phan3.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class X1Phan3 extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
Reference in New Issue
Block a user