afa 5 сар өмнө
parent
commit
e875a94e6f

+ 6 - 21
app/api/controller/Shops.php

@@ -35,30 +35,15 @@ class Shops extends Base
     }
 
 
+    //获取规格
+    public function getSpec(ShopList $shopList){
 
-    public function createAddress(){
-        $tx_hash = Request::post('tx_hash');
-        $api_url = 'http://127.0.0.1:3389/api/txDetail';
-        if(empty($tx_hash)){
+        $shop_id = $this->request->post('shop_id/d');
+        if( empty($shop_id)){
             $this->error('参数有误');
         }
-        $data = [
-            'api_id'  => 1,
-            'coin_type' => 'BEP20',
-            'user_no' => 1,
-            'time_stamp' => 1122,
-            'reset' => true
-        ];
-        $body = $this->doCurlPostRequest($api_url, $data);
-        //dump($body);
-        $info = json_decode($body, true);
-        //dump($body);
-
-        //$body = $this->getInfoByTransactionHash($txhash);
-        if($info['code'] == 200){
-            $this->success('', $info['data']);
-        }
-        $this->error($info['message']);
+     
+        return $this->success('ok', $shopList->where('id', $shop_id)->value('type_spec'));  
     }
 
 

+ 3 - 0
app/api/route/route.php

@@ -18,6 +18,9 @@ Route::group('user', function () {
       //店铺
       Route::rule('shops','shops/getShop','POST');
 
+      //规格
+      Route::rule('spec','spec/getSpec','POST');
+
   })->middleware(AllowCrossDomain::class);