zhangdehua 7 månader sedan
förälder
incheckning
04b5502190
1 ändrade filer med 8 tillägg och 7 borttagningar
  1. 8 7
      app/index/controller/Index.php

+ 8 - 7
app/index/controller/Index.php

@@ -151,7 +151,7 @@ class Index extends Controller
 
         $goodsModel = new GoodsModel();
         $goods = $goodsModel->getDetails($goodsId);
-        if (empty($goods) || (isset($goods['status']) && $goods['status'] == 500)){
+        if (empty($goods) || (isset($goods['status']) && $goods['status'] == 500)) {
             return \view('/error');
         }
         $goods = $goods->toArray();
@@ -161,9 +161,9 @@ class Index extends Controller
         $model = new CommentModel;
         $total = $model->rowsTotal($goodsId);
 
-        $goodsCategory = GoodsCategoryRel::where(['goods_id'=>$goods['goods_id']])->find()->toArray();
-        $is_lost_mary= 0;
-        if ($goodsCategory['category_id'] == GoodsCategoryRel::LOST_MARY_5000){
+        $goodsCategory = GoodsCategoryRel::where(['goods_id' => $goods['goods_id']])->find()->toArray();
+        $is_lost_mary = 0;
+        if ($goodsCategory['category_id'] == GoodsCategoryRel::LOST_MARY_5000) {
             $is_lost_mary = 1;
         }
 
@@ -213,19 +213,20 @@ class Index extends Controller
     public function goldTest()
     {
         $keyFilePath = '/etc/nginx/nginx/html/dihua-01-5690813badec.json';
-        $storage = new StorageClient(['projectId'=>'dihua-01','keyFilePath' => $keyFilePath]);
+        $storage = new StorageClient(['projectId' => 'dihua-01', 'keyFilePath' => $keyFilePath]);
         $bucket = $storage->bucket('freeshippingvps');
 
         $filePath = '/etc/nginx/nginx/html/vape_shop/public/uploads/10001/20240618/24c7b239666052544c6a0a70489f58b6.jpg';
         $storageObj = $bucket->upload(
             fopen($filePath, 'r'),
             [
+                'name' => '/10001/20240618/24c7b239666052544c6a0a70489f58b6.jpg'
                 //'predefinedAcl' => 'publicRead'
             ]
         );
         $name = $storageObj->name();
 
-        return $this->renderSuccess(['name'=>$name],'OK');
+        return $this->renderSuccess(['name' => $name], 'OK');
 
         $ip = $this->request->ip();
         //$b = bcmod(1, 0);
@@ -234,7 +235,7 @@ class Index extends Controller
         Log::error('xxx');
 
         Log::notice($ip);
-        return $this->renderSuccess([],'OK');
+        return $this->renderSuccess([], 'OK');
 
 
         dd($ip);