shish %!s(int64=6) %!d(string=hai) anos
pai
achega
baa861b403

+ 8 - 2
app/shop/controllers/PicController.php

@@ -86,7 +86,7 @@ class PicController extends BaseController
 	//删除图片 shish 2019.12.8
 	public function actionDelete()
 	{
-		$id = Yii::$app->request->get('id', 0);
+		$id = Yii::$app->request->post('id', 0);
 		$info = PicService::getById($id);
 		PicService::valid($info, $this->merchantId);
 		PicService::delPic($id);
@@ -96,7 +96,7 @@ class PicController extends BaseController
 	//置顶 shish 2019.12.8
 	public function actionTop()
 	{
-		$id = Yii::$app->request->get('id', 0);
+		$id = Yii::$app->request->post('id', 0);
 		$info = PicService::getById($id);
 		PicService::valid($info, $this->merchantId);
 		PicService::top($info);
@@ -110,4 +110,10 @@ class PicController extends BaseController
 		util::complete();
 	}
 	
+	//分享 shish 2020.5.8
+	public function actionShare()
+	{
+		util::fail('即将开通');
+	}
+	
 }

+ 2 - 138
common/components/util.php

@@ -168,64 +168,13 @@ class util
         Yii::$app->end();
     }
 
-    /**
-     * 输出json数据并结束运行
-     */
+	//输出json数据并结束运行
     public static function encode($data)
     {
         echo Json::encode($data);
         exit();
     }
 
-    /**
-     * 组合需要的格式,输出json数据并结束运行
-     * code A0001 正确 其它如:A0002表示错误
-     */
-    public static function failInfo($msg = '操作失败', $code = 'A0002', $data = [])
-    {
-        $arr = ['code' => $code, 'msg' => $msg, 'data' => $data];
-        self::encode($arr);
-    }
-
-    public static function successInfo($msg = '操作成功', $code = 'A0001', $data = [])
-    {
-        $arr = ['code' => $code, 'msg' => $msg, 'data' => $data];
-        self::encode($arr);
-    }
-
-    //操作成功,只关心数据的返回
-    public static function sendJson($data)
-    {
-        $arr = ['code' => 1, 'msg' => '操作成功', 'data' => $data];
-        self::encode($arr);
-    }
-
-    //只关心返回失败状态
-    public static function sendFail($msg)
-    {
-        //要输出页面
-        if (isset(Yii::$app->params['exportStyle']) && Yii::$app->params['exportStyle'] == 'web') {
-            //确认平台
-            if (Yii::$app->params['appStyle'] == 'backend') {
-                //跳转 echo '<script> window.location.href=""; </script>';
-            }
-            if (Yii::$app->params['appStyle'] == 'mobile') {
-                //跳转 echo '<script> window.location.href=""; </script>';
-            }
-            Yii::$app->end();
-        }
-        $arr = ['code' => 0, 'msg' => $msg, 'data' => []];
-        self::encode($arr);
-        Yii::$app->end();
-    }
-
-    //只关心返回成功状态
-    public static function sendSuccess()
-    {
-        $arr = ['code' => 1, 'msg' => '操作成功', 'data' => []];
-        self::encode($arr);
-    }
-
     /**
      * 合并图片 ---lqh 2017-05-05
      * @param $background_img  背景原图
@@ -310,57 +259,6 @@ class util
         return '/qrcode/' . $random . '_fullQrImg.png';//组合图片
     }
 
-    /*
-    *功能:php完美实现下载远程图片保存到本地
-    *参数:文件url,保存文件目录,保存文件名称,使用的下载方式
-    *当保存文件名称为空时则使用远程文件原来的名称
-    */
-    function downLoadImage($url, $save_dir = '', $filename = '', $type = 0)
-    {
-        if (trim($url) == '') {
-            return array('file_name' => '', 'save_path' => '', 'error' => 1);
-        }
-        if (trim($save_dir) == '') {
-            $save_dir = './';
-        }
-        if (trim($filename) == '') {//保存文件名
-            $ext = strrchr($url, '.');
-            if ($ext != '.gif' && $ext != '.jpg') {
-                return array('file_name' => '', 'save_path' => '', 'error' => 3);
-            }
-            $filename = time() . $ext;
-        }
-        if (0 !== strrpos($save_dir, '/')) {
-            $save_dir .= '/';
-        }
-        //创建保存目录
-        if (!file_exists($save_dir) && !mkdir($save_dir, 0777, true)) {
-            return array('file_name' => '', 'save_path' => '', 'error' => 5);
-        }
-        //获取远程文件所采用的方法
-        if ($type) {
-            $ch = curl_init();
-            $timeout = 5;
-            curl_setopt($ch, CURLOPT_URL, $url);
-            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
-            $img = curl_exec($ch);
-            curl_close($ch);
-        } else {
-            ob_start();
-            readfile($url);
-            $img = ob_get_contents();
-            ob_end_clean();
-        }
-        //$size=strlen($img);
-        //文件大小
-        $fp2 = @fopen($save_dir . $filename, 'a');
-        fwrite($fp2, $img);
-        fclose($fp2);
-        unset($img, $url);
-        return array('file_name' => $filename, 'save_path' => $save_dir . $filename, 'error' => 0);
-    }
-
     //获取服务器IP
     public static function serverIp()
     {
@@ -376,7 +274,7 @@ class util
         return $server_ip;
     }
 
-    //获取huahuibao根目录 shish 2020.3.11
+    //获取根目录 shish 2020.3.11
     public static function getRootDir()
     {
         $basePath = Yii::$app->basePath;
@@ -388,14 +286,6 @@ class util
         return $root;
     }
 
-    //格式化输出;用于调试时使用 shish 2019.8.20
-    public static function print_r($data)
-    {
-        echo "<pre>";
-        print_r($data);
-        Yii::$app->end();
-    }
-
     //错误输出
     public static function fail($msg = '操作失败')
     {
@@ -422,35 +312,9 @@ class util
         self::encode(['code' => 1, 'msg' => $msg, 'data' => []]);
     }
 
-
     public static function notLogin($msg = '没有登陆')
     {
         self::encode(['code' => -1, 'msg' => $msg, 'data' => []]);
     }
 
-    //shisq
-    public static function echoStatus($num, $key, $status = 'status')
-    {
-        $dictionary = \common\components\configDict::$dict[$key][$status];
-        echo $dictionary[$num];
-    }
-
-    /**
-     * 二维数组根据字段进行排序 shisq
-     * @params array $array 需要排序的数组
-     * @params string $field 排序的字段
-     * @params string $sort 排序顺序标志 SORT_DESC 降序;SORT_ASC 升序
-     */
-    public static function arraySequence($array, $field, $sort = 'SORT_DESC')
-    {
-        $arrSort = array();
-        foreach ($array as $uniqid => $row) {
-            foreach ($row as $key => $value) {
-                $arrSort[$key][$uniqid] = $value;
-            }
-        }
-        array_multisort($arrSort[$field], constant($sort), $array);
-        return $array;
-    }
-
 }

+ 0 - 22
common/services/xhWifiService.php

@@ -30,28 +30,6 @@ class xhWifiService {
 		return xhWifi::getAllByCondition($condition);
 	}
 
-    /**
-     * 下载Wifi二维码图片到本地
-     * @param $shopId
-     * @param $ssid
-     * @param $merchant
-     * @return array
-     */
-	public static function DownLoadWifiQrImg($shopId, $ssid, $merchant){
-        $re = (new wxUtil($merchant))->getWifiQrCode($shopId, $ssid, 0);
-        if($re['errcode'] == 0){
-            $imgUrl = $re['data']['qrcode_url'];
-        }else{
-            return $re['errmsg'];
-        }
-
-        $webRootDir = dirname(Yii::$app->basePath);
-        $saveQrCodeDir = $webRootDir . '/images/qrcode/weixinQrcode';
-
-        $status = util::downLoadImage($imgUrl, $saveQrCodeDir, $shopId.'.jpg');
-        return $status;
-    }
-
     /**
      * Wifi二维码图片是否已下载
      * @param $shopId