sql edits
This commit is contained in:
@@ -16,6 +16,21 @@ use Hekmatinasser\Verta\Verta;
|
||||
|
||||
class TahesabController extends Controller
|
||||
{
|
||||
private function tahesabApiUrl(): string
|
||||
{
|
||||
$host = trim((string) $this->Config('tahesab_host'));
|
||||
$port = trim((string) $this->Config('tahesab_port'));
|
||||
|
||||
if ($host !== '' && $port !== '') {
|
||||
$host = rtrim(preg_replace('#^https?://#i', '', $host), '/');
|
||||
|
||||
return 'http://' . $host . ':' . $port . '/';
|
||||
}
|
||||
|
||||
$legacy = trim((string) env('TAHESAB', ''));
|
||||
|
||||
return $legacy !== '' ? $legacy : '';
|
||||
}
|
||||
|
||||
public function storeTrade($data)
|
||||
{
|
||||
@@ -68,7 +83,7 @@ class TahesabController extends Controller
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"DoNewSanadBuySaleGOLD" => [
|
||||
1,//Sabte_Kol_Or_Movaghat_1_0
|
||||
(int)$customer->moshtari_code, //Moshtari_Code
|
||||
@@ -159,7 +174,7 @@ class TahesabController extends Controller
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"DoNewSanadVKHBank" => [
|
||||
1,//Sabte_Kol_Or_Movaghat_1_0
|
||||
$customer->moshtari_code,//Moshtari_Code
|
||||
@@ -207,7 +222,7 @@ class TahesabController extends Controller
|
||||
// 'DBName' => $this->ConfigService('tahesab_db'),
|
||||
// 'Content-Type' => 'application/json',
|
||||
// 'Authorization' => "Bearer " . $this->ConfigService('tahesab_token'),
|
||||
// ])->post((string)env('TAHESAB'), [
|
||||
// ])->post($this->tahesabApiUrl(), [
|
||||
// "DoNewSanadVKHBank" => [
|
||||
// 1,//Sabte_Kol_Or_Movaghat_1_0
|
||||
// $customer->moshtari_code,//Moshtari_Code
|
||||
@@ -247,7 +262,7 @@ class TahesabController extends Controller
|
||||
// 'DBName' => $this->ConfigService('tahesab_db'),
|
||||
// 'Content-Type' => 'application/json',
|
||||
// 'Authorization' => "Bearer " . $this->ConfigService('tahesab_token'),
|
||||
// ])->post((string)env('TAHESAB'), [
|
||||
// ])->post($this->tahesabApiUrl(), [
|
||||
// "DoNewSanadTalabBedehi" => [
|
||||
// 1,//Sabte_Kol_Or_Movaghat_1_0,
|
||||
// $customer->moshtari_code,//Moshtari_Code
|
||||
@@ -343,7 +358,7 @@ class TahesabController extends Controller
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => 'Bearer ' . $this->Config('tahesab_token'),
|
||||
])->post((string) env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
'DoNewSanadTalabBedehi' => [
|
||||
1, // Sabte_Kol
|
||||
(int) $customer->moshtari_code,
|
||||
@@ -442,7 +457,7 @@ class TahesabController extends Controller
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"DoNewSanadBuySaleGOLD" => [
|
||||
1,//Sabte_Kol_Or_Movaghat_1_0
|
||||
(int)$customer->moshtari_code, //Moshtari_Code
|
||||
@@ -499,7 +514,7 @@ class TahesabController extends Controller
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"DoNewMoshtari" => [
|
||||
(string)$customer->name,
|
||||
$this->Config('name_fa'),
|
||||
@@ -531,7 +546,7 @@ class TahesabController extends Controller
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"DoEditMoshtari" => [
|
||||
$customer->name,
|
||||
$this->Config('name_fa'),
|
||||
@@ -566,7 +581,7 @@ class TahesabController extends Controller
|
||||
'Content-Type' => 'application/json',
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"CheckHealth" => []
|
||||
])->json();
|
||||
|
||||
@@ -584,7 +599,7 @@ class TahesabController extends Controller
|
||||
'Content-Type' => 'application/json',
|
||||
'DBName' => $this->Config('tahesab_db'),
|
||||
'Authorization' => "Bearer " . $this->Config('tahesab_token'),
|
||||
])->post((string)env('TAHESAB'), [
|
||||
])->post($this->tahesabApiUrl(), [
|
||||
"DoListAsnad" => [
|
||||
10, /*Count_Last,*/
|
||||
"", /*Moshtari_Code,*/
|
||||
|
||||
Reference in New Issue
Block a user