| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | 
							- <?php
 
- /**
 
-  * Here is your custom functions.
 
-  */
 
- if (!function_exists('http_post')) {
 
-     function http_post($url,$params){
 
-         $ch = curl_init();
 
-         $this_header = array("content-type: application/x-www-form-urlencoded;charset=UTF-8");
 
-         curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
 
-         curl_setopt($ch, CURLOPT_URL, $url);
 
-         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
-         curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
 
-         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
 
-         curl_setopt($ch, CURLOPT_POST, 1);
 
-         curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
 
-         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);//如果不加验证,就设false,商户自行处理
 
-         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
 
-         $output = curl_exec($ch);
 
-         curl_close($ch);
 
-         return $output;
 
-     }
 
- }
 
- if (!function_exists('month_12')){
 
-     function month_12(){
 
-         $months = [];
 
-         for ($i=0;$i<12;$i++){
 
-             $months[$i] = date('Y/m',strtotime("-".$i."month"));
 
-         }
 
-         return $months;
 
-     }
 
- }
 
- /**
 
-  * @Desc 管理员操作日志
 
-  * @Author Gorden
 
-  * @Date 2024/3/29 17:07
 
-  *
 
-  * adminId = 1001 充值
 
-  *
 
-  *
 
-  * @param $name
 
-  * @param $operation
 
-  * @return void
 
-  */
 
- if (!function_exists('_syslog')) {
 
-     function _syslog($name, $operation, $operationData = false, $requestParams = false, $adminId = false)
 
-     {
 
-         $logAdminId = $adminId ? $adminId : \Tinywan\Jwt\JwtToken::getCurrentId();
 
-         $model = new \app\model\SysLog();
 
-         $model->log_admin_id = $logAdminId;
 
-         $model->log_name = $name;
 
-         $model->log_route = \request()->uri() ?? \request()->route->getPath();
 
-         $model->log_operation = $operation;
 
-         $model->log_ip = \request()->getRealIp();
 
-         $model->log_request_params = $requestParams ? json_encode($requestParams) : json_encode(\request()->all());
 
-         $model->log_operation_data = $operationData ? json_encode($operationData) : null;
 
-         $model->save();
 
-     }
 
- }
 
 
  |