更新
This commit is contained in:
parent
a4c7f89519
commit
aa07cc9a50
@ -30,73 +30,15 @@ use crmeb\jobs\ProductCopyJob;
|
|||||||
class Demo extends BaseController
|
class Demo extends BaseController
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{ return app('json')->success('修改成功');
|
||||||
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]);//短信通知
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// $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('is_del',1)->field('product_id')->select();
|
||||||
|
// foreach($arr as $item){
|
||||||
|
|
||||||
$mer_id=236;//导入到的商户
|
// Queue::push(ProductCopyJob::class, ['product_id' => $item['product_id']]);//短信通知
|
||||||
$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]);//短信通知
|
|
||||||
}
|
|
||||||
|
|
||||||
$mer_id=239;//导入到的商户
|
|
||||||
$street_code=510521116;//导入到的商户
|
|
||||||
|
|
||||||
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=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]);//短信通知
|
|
||||||
}
|
|
||||||
|
|
||||||
$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]);//短信通知
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function transcoding($fileName)
|
public function transcoding($fileName)
|
||||||
|
@ -16,15 +16,26 @@ namespace crmeb\jobs;
|
|||||||
|
|
||||||
use crmeb\interfaces\JobInterface;
|
use crmeb\interfaces\JobInterface;
|
||||||
use app\controller\admin\store\StoreProduct;
|
use app\controller\admin\store\StoreProduct;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本地跑远程线程专门使用
|
||||||
|
*/
|
||||||
class ProductCopyJob implements JobInterface
|
class ProductCopyJob implements JobInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function fire($job, $data)
|
public function fire($job, $data)
|
||||||
{
|
{
|
||||||
$make = app()->make(StoreProduct::class);
|
// $arrs= Db::name('store_product')->where('old_product_id',$data['product_id'])->select();
|
||||||
$make->copy($data['product_id'],$data['mer_id'],$data['street_code'],$data['type_id'],$data['category_id']);
|
// foreach($arrs as $it){
|
||||||
|
// $res= Db::name('store_product')->where('product_id',$it['product_id'])->update(['is_del'=>1,'is_show'=>0,'is_used'=>0,'status'=>-2]);
|
||||||
|
// if($res){
|
||||||
|
// Db::name('cloud_product')->where('product_id',$it['product_id'])->delete();
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// $make = app()->make(StoreProduct::class);
|
||||||
|
// $make->copy($data['product_id'],$data['mer_id'],$data['street_code'],$data['type_id'],$data['category_id']);
|
||||||
$job->delete();
|
$job->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user