2023-11-23 13:34:40 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
// | Author: CRMEB Team <admin@crmeb.com>
|
|
|
|
|
// +----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace app\controller\api;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use crmeb\basic\BaseController;
|
2023-11-23 16:39:20 +08:00
|
|
|
|
use think\facade\Db;
|
|
|
|
|
use crmeb\services\UploadService;
|
|
|
|
|
use Exception;
|
|
|
|
|
use ZipArchive;
|
2024-01-21 19:21:38 +08:00
|
|
|
|
use think\facade\Queue;
|
|
|
|
|
use crmeb\jobs\ProductCopyJob;
|
2023-11-23 13:34:40 +08:00
|
|
|
|
/**
|
|
|
|
|
* Class Auth
|
|
|
|
|
* @package app\controller\api
|
|
|
|
|
* @author xaboy
|
|
|
|
|
* @day 2020-05-06
|
|
|
|
|
*/
|
|
|
|
|
class Demo extends BaseController
|
|
|
|
|
{
|
2023-11-23 16:39:20 +08:00
|
|
|
|
public function index()
|
|
|
|
|
{
|
2024-01-22 00:28:08 +08:00
|
|
|
|
return app('json')->success('修改成功');
|
|
|
|
|
$arr=Db::name('store_product')->whereIn('mer_id',[110,116,149,227,226,35,117,148,156,104,137,151,136,183,140,229,79,133,235])->where('status',1)->where('is_show',0)->field('product_id')->select();
|
|
|
|
|
$mer_id=167;//导入到的商户
|
|
|
|
|
$street_code=510521107;//导入到的商户
|
|
|
|
|
$type_id=17;//导入到的商户分类
|
|
|
|
|
$category_id=2566;//导入到的商户分类
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$mer_id=236;//导入到的商户
|
|
|
|
|
$street_code=510521123;//导入到的商户
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mer_id=237;//导入到的商户
|
|
|
|
|
$street_code=510521115;//导入到的商户
|
|
|
|
|
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mer_id=238;//导入到的商户
|
|
|
|
|
$street_code=510521105;//导入到的商户
|
|
|
|
|
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-21 22:51:04 +08:00
|
|
|
|
$mer_id=239;//导入到的商户
|
|
|
|
|
$street_code=510521116;//导入到的商户
|
2024-01-22 00:28:08 +08:00
|
|
|
|
|
2024-01-21 22:51:04 +08:00
|
|
|
|
foreach($arr as $k=>$v){
|
2024-01-22 00:28:08 +08:00
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
2024-01-21 22:51:04 +08:00
|
|
|
|
}
|
2024-01-21 19:21:38 +08:00
|
|
|
|
|
2024-01-22 00:28:08 +08:00
|
|
|
|
//江阳
|
|
|
|
|
$mer_id=31;//导入到的商户
|
|
|
|
|
$street_code=510502108;//导入到的商户
|
|
|
|
|
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
2023-11-29 22:55:47 +08:00
|
|
|
|
}
|
2023-11-30 09:15:35 +08:00
|
|
|
|
|
2024-01-22 00:28:08 +08:00
|
|
|
|
$mer_id=32;//导入到的商户
|
|
|
|
|
$street_code=510502107;//导入到的商户
|
|
|
|
|
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mer_id=118;//导入到的商户
|
|
|
|
|
$street_code=510502106;//导入到的商户
|
|
|
|
|
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$mer_id=39;//导入到的商户
|
|
|
|
|
$street_code=510502105;//导入到的商户
|
|
|
|
|
|
|
|
|
|
foreach($arr as $k=>$v){
|
|
|
|
|
Queue::push(ProductCopyJob::class, ['product_id' => $v['product_id'], 'mer_id' =>$mer_id,'street_code'=>$street_code,'type_id'=>$type_id,'category_id'=>$category_id]);//短信通知
|
2023-11-23 16:39:20 +08:00
|
|
|
|
}
|
2023-11-23 13:34:40 +08:00
|
|
|
|
}
|
2023-11-29 22:55:47 +08:00
|
|
|
|
|
|
|
|
|
public function transcoding($fileName)
|
|
|
|
|
{
|
|
|
|
|
$encoding = mb_detect_encoding($fileName, ['UTF-8', 'GBK', 'BIG5', 'CP936']);
|
|
|
|
|
if (DIRECTORY_SEPARATOR == '/') { // linux
|
|
|
|
|
$fileName = iconv($encoding, 'UTF-8', $fileName);
|
|
|
|
|
} else { // win
|
|
|
|
|
$fileName = iconv($encoding, 'GBK', $fileName);
|
|
|
|
|
}
|
|
|
|
|
return $fileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createDirectories($path) {
|
|
|
|
|
if (is_dir($path)) {
|
|
|
|
|
return true ;
|
|
|
|
|
} else {
|
|
|
|
|
$parts = explode(DIRECTORY_SEPARATOR, $path);
|
|
|
|
|
$part = null;
|
|
|
|
|
|
|
|
|
|
foreach ($parts as $part) {
|
|
|
|
|
if ($part === '' || $part === '.' || $part === '..') {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$dir = dirname($path) . DIRECTORY_SEPARATOR . $part;
|
|
|
|
|
if (!file_exists($dir)) {
|
|
|
|
|
mkdir($dir, 0777, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-23 13:34:40 +08:00
|
|
|
|
}
|