|
@@ -4,7 +4,7 @@ declare (strict_types = 1);
|
|
|
namespace app\command;
|
|
|
|
|
|
use app\admin\model\GoodBasic;
|
|
|
-use app\admin\model\GoodZixun;
|
|
|
+use app\admin\model\GoodCombind;use app\admin\model\GoodZixun;
|
|
|
use app\user\model\TaxRelation;
|
|
|
use think\console\Command;
|
|
|
use think\console\Input;
|
|
@@ -31,6 +31,7 @@ class sysGood extends Command
|
|
|
try {
|
|
|
$this->processGoods('goodBasic');
|
|
|
$this->processGoods('goodZx');
|
|
|
+ $this->goodCombind();
|
|
|
} catch (\Exception $e) {
|
|
|
$output->writeln('【' . date('Y-m-d H:i:s') . '】' . $e->getMessage());
|
|
|
}
|
|
@@ -118,4 +119,20 @@ class sysGood extends Command
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ protected function goodCombind()
|
|
|
+ {
|
|
|
+ $list =GoodCombind::where('createtime','>=', $this->date)
|
|
|
+ ->select();
|
|
|
+ if(empty($list)==false){
|
|
|
+ $add=[];
|
|
|
+ foreach($list as $item){
|
|
|
+ unset($item['id']);
|
|
|
+ $ist=GoodCombind::where(['spuCode'=>$item['spuCode'],'childCode'=>$item['childCode']])->findOrEmpty();
|
|
|
+ if($ist->isEmpty())$add[]=$item;
|
|
|
+ }
|
|
|
+ (new \app\cxinv\model\GoodCombind)->saveAll($add);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|