more phpcsfix
This commit is contained in:
parent
2c306cdbd6
commit
b2eb9c62ca
2 changed files with 9 additions and 4 deletions
|
|
@ -51,7 +51,6 @@ class ProductsController extends Controller
|
|||
}
|
||||
$searchFields = trans('Nom, Desc., Ingr., Cons., Tags, Infos');
|
||||
$p = $p->paginate();
|
||||
// dd($p);
|
||||
return view('bo.products.index', compact('p', 'searchFields', 'ranges'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ class MesBR
|
|||
}
|
||||
public function printCoupons(string $hashcode, array $coupons)
|
||||
{
|
||||
return $this->callApi("GET", '/coupons/print', ['refcamp' => $this->refCamp, 'hashcode' => $hashcode, 'coupons' => implode(",", $coupons)]);
|
||||
return $this->callApi("GET", '/coupons/print', [
|
||||
'refcamp' => $this->refCamp, 'hashcode' => $hashcode, 'coupons' => implode(",", $coupons)
|
||||
]);
|
||||
}
|
||||
private function callApi($method, $url, $data = [])
|
||||
{
|
||||
|
|
@ -65,10 +67,14 @@ class MesBR
|
|||
if (!curl_errno($curl)) {
|
||||
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
if (!in_array($http_code, [200, 201])) {
|
||||
return (object)['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed - Code HTTP : ' . $http_code];
|
||||
return (object)[
|
||||
'status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed - Code HTTP : ' . $http_code
|
||||
];
|
||||
}
|
||||
} else {
|
||||
return (object)['status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed : ' . curl_error($curl)];
|
||||
return (object)[
|
||||
'status' => 'KO', 'code' => 500, 'message' => 'Connection to API failed : ' . curl_error($curl)
|
||||
];
|
||||
}
|
||||
curl_close($curl);
|
||||
return json_decode($result);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue