lizhen_gitee 2 mēneši atpakaļ
vecāks
revīzija
002411032f

+ 2 - 95
addons/unishop/controller/Product.php

@@ -88,8 +88,8 @@ class Product extends Base
                 ->cache(10)->find();
 
             //优惠券
-            $data->coupon = (new Coupon)->where('endtime', '>', time())
-                ->where(['switch' => Coupon::SWITCH_ON])->cache(10)->order('weigh DESC')->select();
+            /*$data->coupon = (new Coupon)->where('endtime', '>', time())
+                ->where(['switch' => Coupon::SWITCH_ON])->cache(10)->order('weigh DESC')->select();*/
 
             // 是否已收藏
             if ($this->auth->id) {
@@ -180,99 +180,6 @@ class Product extends Base
         $this->success('', $result);
     }
 
-    //腾讯云拍照识别商品
-    //{"Response":{"Products":[{"Name":"按摩椅","Parents":"家用电器-个护健康","Confidence":99,"XMin":107,"YMin":59,"XMax":447,"YMax":366}],"RequestId":"187745fc-0497-441e-88f5-f3f17d854016"}}
-    private function search_by_image($image){
-
-        $image = $image.'?imageMogr2/thumbnail/800x800';
-
-        $tencent_yun = config('tencent_yun');
-        $secret_id   = $tencent_yun['secret_id'];
-        $secret_key  = $tencent_yun['secret_key'];
-
-        $token       = "";
-        $service     = "tiia";
-        $host        = "tiia.tencentcloudapi.com";
-        $req_region  = "ap-beijing";
-        $version     = "2019-05-29";
-        $action      = "DetectProduct";
-        $payload     = json_encode(['ImageUrl' => localpath_to_netpath($image)]);
-        $endpoint    = "https://tiia.tencentcloudapi.com";
-        $algorithm   = "TC3-HMAC-SHA256";
-        $timestamp   = time();
-        $date        = gmdate("Y-m-d", $timestamp);
-
-// ************* 步骤 1:拼接规范请求串 *************
-        $http_request_method = "POST";
-        $canonical_uri = "/";
-        $canonical_querystring = "";
-        $ct = "application/json; charset=utf-8";
-        $canonical_headers = "content-type:".$ct."\nhost:".$host."\nx-tc-action:".strtolower($action)."\n";
-        $signed_headers = "content-type;host;x-tc-action";
-        $hashed_request_payload = hash("sha256", $payload);
-        $canonical_request = "$http_request_method\n$canonical_uri\n$canonical_querystring\n$canonical_headers\n$signed_headers\n$hashed_request_payload";
-
-// ************* 步骤 2:拼接待签名字符串 *************
-        $credential_scope = "$date/$service/tc3_request";
-        $hashed_canonical_request = hash("sha256", $canonical_request);
-        $string_to_sign = "$algorithm\n$timestamp\n$credential_scope\n$hashed_canonical_request";
-
-// ************* 步骤 3:计算签名 *************
-        $secret_date    = hash_hmac("sha256", $date, "TC3".$secret_key, true);
-        $secret_service = hash_hmac("sha256", $service, $secret_date, true);
-        $secret_signing = hash_hmac("sha256", "tc3_request", $secret_service, true);
-        $signature      = hash_hmac("sha256", $string_to_sign, $secret_signing);
-
-// ************* 步骤 4:拼接 Authorization *************
-        $authorization = "$algorithm Credential=$secret_id/$credential_scope, SignedHeaders=$signed_headers, Signature=$signature";
-
-// ************* 步骤 5:构造并发起请求 *************
-        $headers = [
-            "Authorization"  => $authorization,
-            "Content-Type"   => "application/json; charset=utf-8",
-            "Host"           => $host,
-            "X-TC-Action"    => $action,
-            "X-TC-Timestamp" => $timestamp,
-            "X-TC-Version"   => $version
-        ];
-        if ($req_region) {
-            $headers["X-TC-Region"] = $req_region;
-        }
-        if ($token) {
-            $headers["X-TC-Token"] = $token;
-        }
-        $headers = array_map(function ($k, $v) { return "$k: $v"; }, array_keys($headers), $headers);
-
-        try {
-            $timeOut = 3;
-            $ch = curl_init();
-            curl_setopt($ch, CURLOPT_URL, $endpoint);
-            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
-            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
-            curl_setopt($ch, CURLOPT_TIMEOUT, $timeOut);
-            curl_setopt($ch, CURLOPT_HEADER, 0);
-            curl_setopt($ch, CURLOPT_POST, 1);
-            curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
-            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
-            $response = curl_exec($ch);
-            curl_close($ch);
-
-            //return $response;
-            $response = json_decode($response,true);
-            if(is_array($response) && isset($response['Response']['Products'][0]['Name'])){
-                $searchname = $response['Response']['Products'][0]['Name'];
-                if(!empty($searchname)){
-                    return $searchname;
-                }
-            }
-            return '';
-        } catch (Exception $err) {
-            //echo $err->getMessage();
-            return '';
-        }
-
-    }
 
 
     /**

+ 2 - 2
application/admin/view/unishop/product/add.html

@@ -61,7 +61,7 @@
             <ul class="row list-inline plupload-preview" id="p-images"></ul>
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Video_file')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
@@ -74,7 +74,7 @@
             </div>
             <ul class="row list-inline faupload-preview" id="p-video_file"></ul>
         </div>
-    </div>
+    </div>-->
 
     <style>
         table tr td, table tr th {

+ 2 - 2
application/admin/view/unishop/product/edit.html

@@ -61,7 +61,7 @@
             <ul class="row list-inline plupload-preview" id="p-images"></ul>
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Video_file')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
@@ -74,7 +74,7 @@
             </div>
             <ul class="row list-inline faupload-preview" id="p-video_file"></ul>
         </div>
-    </div>
+    </div>-->
 
     <style>
         table tr td, table tr th {

+ 4 - 24
application/api/controller/Userbank.php

@@ -20,38 +20,18 @@ class Userbank extends Api
     /**
      * 绑定银行卡
      */
-    public function bindBank() {
-
-        $captcha = input('captcha');
-        if (!$captcha) {
-            $this->error(__('Invalid parameters'));
-        }
-        $result = Sms::check($this->auth->mobile, $captcha, 'changemobile');
-        if (!$result) {
-            $this->error(__('Captcha is incorrect'));
-        }
+    public function bindbank() {
 
         //
         $bank_no = input('bank_no');// 银行账号
         $open_bank = input('open_bank');// 开户行
-        if(!$bank_no || !$open_bank ) {
+        $realname = input('realname');// 姓名
+        if(!$bank_no || !$open_bank  || !$realname ) {
             $this->error("请将信息填写完整");
         }
 
         $userId = $this->auth->id;
 
-        //检测实名认证
-        $userAuthWhere['user_id'] = $userId;
-        $userAuth = Db::name('user_idconfirm')->where($userAuthWhere)->find();
-        if (empty($userAuth)) {
-            $this->error('请先实名认证');
-        }
-        if ($userAuth['status'] != 1) {
-            $this->error('请先实名认证通过');
-        }
-        $realname = $userAuth['realname'];
-
-
         // 查询是否有过绑定
         $bankInfo = Db::name('user_bank')->where(["user_id"=>$userId])->find();
         $data = [];
@@ -74,7 +54,7 @@ class Userbank extends Api
     /**
      * 获取绑定银行卡信息
      */
-    public function getBankInfo() {
+    public function getbankinfo() {
         // 查询是否有过绑定
         $bankInfo = Db::name('user_bank')->where(["user_id"=>$this->auth->id])->find();