36 lines
700 B
PHP
36 lines
700 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Pay;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class BaseController extends Controller
|
|
{
|
|
//
|
|
public $debug = 1;
|
|
public function debugLog($str = '', $arr = [])
|
|
{
|
|
if ($str) {
|
|
if ($this->debug) {
|
|
Log::info($str, $arr);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
public function msg($data){
|
|
if(request()->ajax())
|
|
{
|
|
return response()->json($data);
|
|
}
|
|
return $this->htmlAlert($data);
|
|
|
|
}
|
|
public function htmlAlert($data){
|
|
echo '<script>alert("'.$data['msg'].'");window.history.back()</script>';
|
|
}
|
|
}
|