NASER fix tahesab issues

This commit is contained in:
gholak tala
2026-03-14 16:21:42 +00:00
parent b5463e1208
commit fe83dc661a
2 changed files with 35 additions and 28 deletions
@@ -108,16 +108,16 @@ class TahesabController extends Controller
// directon: 0 = daryaft az moshtari
// directon: 1 = pardakht be moshtari
public function wallet($input = null)
public function wallet($data)
{
if ($input instanceof \Illuminate\Http\Request) {
$data = $input->all();
} elseif (is_array($input)) {
$data = $input;
} else {
$data = request()->all();
}
// if ($input instanceof \Illuminate\Http\Request) {
// $data = $input->all();
// } elseif (is_array($input)) {
// $data = $input;
// } else {
// $data = request()->all();
// }
if (!isset($data['customer_id']) || !isset($data['value'])) {
return request()->expectsJson()
@@ -169,28 +169,31 @@ class TahesabController extends Controller
-1,
//MultiRadif
]
]);
])->json();
} catch (\Exception $e) {
return $e->getMessage();
}
if ($response['OK']) {
$tahesab->sh_factor = $response['Sh_factor'];
$tahesab->tahesab_id = $response['OK'];
$tahesab->save();
Tahesab::where('id', $tahesab->id)->update([
"sh_factor" => $response['Sh_factor'],
"tahesab_id" => $response['OK'],
"res" => json_encode($response, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT),
]);
return $data;
}
return false;
}
public function walletGold($input = null)
public function walletGold($data)
{
if ($input instanceof \Illuminate\Http\Request) {
$data = $input->all();
} elseif (is_array($input)) {
$data = $input;
} else {
$data = request()->all();
}
// if ($input instanceof \Illuminate\Http\Request) {
// $data = $input->all();
// } elseif (is_array($input)) {
// $data = $input;
// } else {
// $data = request()->all();
// }
// return ($data);
if (!isset($data['customer_id'])) {
@@ -256,18 +259,20 @@ class TahesabController extends Controller
0, //Jens_Felez
(string)$date,
]
]);
])->json();
} catch (Exception $e) {
return $e->getMessage();
}
if ($response['OK']) {
$tahesab->sh_factor = $response['Sh_factor'];
$tahesab->tahesab_id = $response['OK'];
$tahesab->factor_number = $response['Factor_Number'];
$tahesab->tah_id = $response['ID'];
$tahesab->res = $response;
$tahesab->data = $data;
$tahesab->save();
Tahesab::where('id', $tahesab->id)->update([
"sh_factor" => $response['Sh_factor'],
"tahesab_id" => $response['OK'],
"factor_number" => $response['Factor_Number'],
"tah_id" => $response['ID'],
"data" => json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT),
"res" => json_encode($response, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT),
]);
return $data;
}
return false;
+2
View File
@@ -24,6 +24,8 @@ class Tahesab extends Model
'res',
'factor_number',
'tah_id',
'type',
'data',
];