Kaynağa Gözat

产品图片同步

xialei 1 yıl önce
ebeveyn
işleme
f8346199ef

+ 1 - 0
app/command/PensionTasks.php

@@ -443,6 +443,7 @@ class PensionTasks extends Command
443 443
      */
444 444
     public function doOnlineOrderGzc($timeLimit)
445 445
     {
446
+        return true;
446 447
          // 普通订单
447 448
         $cursor = Db::table('rrx_store_order')->where('paid', 1)->where('gzc', 0)->where('pay_type', 'in', '0,1,2,4')->cursor();
448 449
         $StoreOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);

+ 118 - 54
app/controller/api/cron/CommissionCron.php

@@ -1310,63 +1310,127 @@ where o.paid=1 and o.is_settlement=1 and settlement_time between '$this->startMo
1310 1310
 
1311 1311
     public function cesexx(){
1312 1312
 
1313
+        // $store_product = Db::name('store_product')->where('mer_id', 439)->select();
1314
+        // foreach ($store_product as $key=>$online) {
1315
+        //     $spu_id = $online['spu_id'];
1316
+        //     $product_id = $online['product_id'];
1317
+        //     $data = Db::name('douhuomall')->where('spu_id', $spu_id)->find();
1318
+        //     if(!$data) continue;
1319
+
1320
+        //     //商品主图
1321
+        //     $spuId_info=json_decode($data['spuId_info'],true);
1322
+        //     $slider_image=$spuId_info['detail_img_list']??'';
1323
+        //     $image=$spuId_info['cover_url']??'';
1324
+        //     try {
1325
+        //         $slider_image = implode(',',json_decode($slider_image,true));
1326
+        //     }catch (\Exception $exception){
1327
+        //         $slider_image = $image;
1328
+        //     }
1329
+    
1330
+        //     //更新产品图片数据
1331
+        //     $product_insert_data=[
1332
+        //         'image'=>$image,
1333
+        //         'slider_image'=>$slider_image,
1334
+        //     ];
1335
+        //     Db::name('store_product')->where('product_id',$product_id)->update($product_insert_data);
1336
+        //     echo '更新产品图片数据成功'.json_encode($product_insert_data);
1337
+        //     echo '产品id:'.$product_id;
1338
+        //     $detail = $spuId_info['detail'];
1339
+        //     if(!is_null(json_decode($detail))){
1340
+        //         $detail_list = json_decode($detail);
1341
+        //         $detail = '';
1342
+        //         foreach($detail_list as $value){
1343
+        //             $detail .= "<img src='".$value."' referrerpolicy='no-referrer' /></img>";
1344
+        //         }
1345
+        //     }
1346
+        //     Db::name('store_product_content')->where('product_id',$product_id)->update(['content'=>$detail]);
1347
+        // }
1348
+
1349
+
1350
+        // $cursor = Db::name('store_order')->where('mer_id', 439)->select();
1351
+        // foreach ($cursor as $key=>$online) {
1352
+        //     // if($key != 0) continue;
1353
+        //     $order_id = $online['order_id'];
1354
+        //     $orderProduct = Db::name('store_order')->alias('so')->where('so.order_id',$order_id)->leftJoin('store_order_product sop','so.order_id=sop.order_id')->field('sop.*')->select()->toArray();
1355
+        //     foreach ($orderProduct as $_k=>&$_vv){
1356
+        //         $_vv['cart_info'] = json_decode($_vv['cart_info'],true);
1357
+        //         if(isset($_vv['cart_info']['product']['product_id'])){
1358
+        //             $image = Db::name('store_product')->where('product_id', $_vv['cart_info']['product']['product_id'])->value('image');
1359
+        //             if($image){
1360
+        //                 $_vv['cart_info']['product']['image'] = $image;
1361
+        //             }
1362
+        //         }
1363
+        //         Db::name('store_order_product')->where('order_id', $order_id)->update(['cart_info'=> json_encode($_vv['cart_info'], true)]);
1364
+        //     }
1365
+        // }
1366
+
1367
+
1368
+
1369
+
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1313 1377
         // 普通订单
1314
-        $cursor = Db::table('rrx_store_order')->where('paid', 1)->where('gzc', 0)->where('mer_id', 496)->where('pay_type', 'in', [0,1,2,4])->select();
1315
-        $StoreOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
1316
-        $OrderMerchantRepository    = app()->make(OrderMerchantRepository::class);
1317
-        $OrderGzcRepository         = app()->make(OrderGzcRepository::class);
1318
-        foreach ($cursor as $online) {
1319
-            if ($online['mer_id'] == 496) {
1320
-                if (!in_array($online['status'], [0, 1, 2, 3])) {
1321
-                    continue;
1322
-                }
1323
-            }
1378
+        // $cursor = Db::table('rrx_store_order')->where('paid', 1)->where('gzc', 0)->where('mer_id', 496)->where('pay_type', 'in', [0,1,2,4])->select();
1379
+        // $StoreOrderStatusRepository = app()->make(StoreOrderStatusRepository::class);
1380
+        // $OrderMerchantRepository    = app()->make(OrderMerchantRepository::class);
1381
+        // $OrderGzcRepository         = app()->make(OrderGzcRepository::class);
1382
+        // foreach ($cursor as $online) {
1383
+        //     if ($online['mer_id'] == 496) {
1384
+        //         if (!in_array($online['status'], [0, 1, 2, 3])) {
1385
+        //             continue;
1386
+        //         }
1387
+        //     }
1324 1388
 
1325
-            $certification = UserCertification::getInstance()->where('uid', $online['uid'])->find();
1326
-            if (!$certification) {
1327
-                Log::info($online['uid'] . '没有实名认证');
1328
-                // echo '没有实名认证';
1329
-                continue;
1330
-            }
1331
-            //查询养老金金额
1332
-            $UserBillRepository = app()->make(UserBillRepository::class);
1333
-            $bill               = $UserBillRepository->getWhere(['uid' => $online['uid'], 'link_id' => $online['order_id'], 'commission_type' => 5]);
1334
-
1335
-            $pension = $bill->number ?? 0;
1336
-            if ($pension <= 0) {
1337
-                echo '金额为为0:'.$online['order_sn'];
1338
-                Log::info($online['order_sn'] . 'pension' . $pension);
1339
-                continue;
1340
-            }
1389
+        //     $certification = UserCertification::getInstance()->where('uid', $online['uid'])->find();
1390
+        //     if (!$certification) {
1391
+        //         Log::info($online['uid'] . '没有实名认证');
1392
+        //         // echo '没有实名认证';
1393
+        //         continue;
1394
+        //     }
1395
+        //     //查询养老金金额
1396
+        //     $UserBillRepository = app()->make(UserBillRepository::class);
1397
+        //     $bill               = $UserBillRepository->getWhere(['uid' => $online['uid'], 'link_id' => $online['order_id'], 'commission_type' => 5]);
1398
+
1399
+        //     $pension = $bill->number ?? 0;
1400
+        //     if ($pension <= 0) {
1401
+        //         echo '金额为为0:'.$online['order_sn'];
1402
+        //         Log::info($online['order_sn'] . 'pension' . $pension);
1403
+        //         continue;
1404
+        //     }
1341 1405
 
1342
-            Db::transaction(function () use ($certification, $online, $pension, $OrderGzcRepository, $OrderMerchantRepository) {
1343
-                //新增入账明细记录
1344
-                $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1345
-                $create    = [
1346
-                    'uid'          => $online['uid'],
1347
-                    'platform_no'  => $orderId,
1348
-                    'account_type' => $online['pay_type'] == 1 ? 3 : 2,
1349
-                    'user_name'    => $certification['user_name'],
1350
-                    'mobile'       => $certification['mobile'],
1351
-                    'user_card'    => $certification['user_card'],
1352
-                    'pension'      => $pension,
1353
-                    'order_type'   => 2,
1354
-                    'out_trade_no' => $online['order_sn']
1355
-                ];
1356
-                $test_user = Db::name('user')->where('uid', $online['uid'])->value('test_user');
1357
-                $check     = Db::name("gzc_logs")->where("out_trade_no", $online['order_sn'])->where("order_type", 2)->count();
1358
-                if ($test_user == 0 && $check <= 0) {
1359
-                    $OrderGzcRepository->create($create);
1360
-                }
1361
-                $order                  = StoreOrder::getInstance()->find($online['order_id']);
1362
-                $order->gzc             = 1;
1363
-                $order->save();
1364
-            });
1365
-
1366
-            $bill->gzc = 1;
1367
-            $bill->is_gzc = 1;
1368
-            $bill->save();
1369
-        }
1406
+        //     Db::transaction(function () use ($certification, $online, $pension, $OrderGzcRepository, $OrderMerchantRepository) {
1407
+        //         //新增入账明细记录
1408
+        //         $orderId   = $OrderMerchantRepository->getNewOrderId('IN10');
1409
+        //         $create    = [
1410
+        //             'uid'          => $online['uid'],
1411
+        //             'platform_no'  => $orderId,
1412
+        //             'account_type' => $online['pay_type'] == 1 ? 3 : 2,
1413
+        //             'user_name'    => $certification['user_name'],
1414
+        //             'mobile'       => $certification['mobile'],
1415
+        //             'user_card'    => $certification['user_card'],
1416
+        //             'pension'      => $pension,
1417
+        //             'order_type'   => 2,
1418
+        //             'out_trade_no' => $online['order_sn']
1419
+        //         ];
1420
+        //         $test_user = Db::name('user')->where('uid', $online['uid'])->value('test_user');
1421
+        //         $check     = Db::name("gzc_logs")->where("out_trade_no", $online['order_sn'])->where("order_type", 2)->count();
1422
+        //         if ($test_user == 0 && $check <= 0) {
1423
+        //             $OrderGzcRepository->create($create);
1424
+        //         }
1425
+        //         $order                  = StoreOrder::getInstance()->find($online['order_id']);
1426
+        //         $order->gzc             = 1;
1427
+        //         $order->save();
1428
+        //     });
1429
+
1430
+        //     $bill->gzc = 1;
1431
+        //     $bill->is_gzc = 1;
1432
+        //     $bill->save();
1433
+        // }
1370 1434
 
1371 1435
 
1372 1436
         

+ 3 - 2
app/controller/api/douhuomall/Take.php

@@ -53,7 +53,7 @@ class Take
53 53
                 $goodsInfo['detail'] = "";
54 54
                 $detail_img = $this->seveImg($value['goods_id'], $goodsInfo['detail_img'], $targetDir);
55 55
                 foreach($detail_img as $img_url){
56
-                    $img_url = "<img src='".$img_url."' />";
56
+                    $img_url = "<img src='".$img_url."' referrerpolicy='no-referrer' />";
57 57
                     $goodsInfo['detail'] = $goodsInfo['detail'].$img_url;
58 58
                 }
59 59
 
@@ -132,7 +132,7 @@ class Take
132 132
             $detail_list = json_decode($detail);
133 133
             $detail = '';
134 134
             foreach($detail_list as $value){
135
-                $detail .= '<img src="'.$value.'"></img>';
135
+                $detail .= "<img src='".$value."' referrerpolicy='no-referrer' /></img>";
136 136
             }
137 137
         }
138 138
         Db::name('store_product_content')->where('product_id',$product_id)->update(['content'=>$detail]);
@@ -143,6 +143,7 @@ class Take
143 143
 
144 144
     public function seveImg($goods_id, $img_url, $targetDir)
145 145
     {
146
+        return $img_url;
146 147
         if(!$img_url) return $img_url;
147 148
         if (is_array($img_url)){
148 149
             $new_img_url = [];