|
@@ -6,7 +6,7 @@ namespace app\command;
|
|
|
use app\admin\model\CgdCaixiao;
|
|
|
use app\admin\model\GoodCombind;
|
|
|
use app\admin\model\GoodTax;
|
|
|
-use app\admin\model\Platform;
|
|
|
+use app\admin\model\OrderTax;use app\admin\model\Platform;
|
|
|
use app\admin\model\SaleCaixiao;
|
|
|
use app\model\TaxRelation;
|
|
|
use think\console\Command;
|
|
@@ -31,7 +31,7 @@ class caixiao extends Command
|
|
|
$unique = md5($item->cgdNo.$item->updatetime);
|
|
|
$temp=['order_type'=>2,'uniqkey'=>$unique,'status'=>1,'addtime'=>date('Y-m:d H:i:s')];
|
|
|
if($this->isInCfp($unique)){
|
|
|
- $item['inv_cat_info'] = $this->spuCat($item->spuCode,$item->open_type,$item->order_source!=8?1:2);
|
|
|
+ $item['inv_cat_info'] = OrderTax::spuCat($item->spuCode,$item->open_type,$item->order_source!=8?1:2);
|
|
|
$item['cat_name'] = json_decode($item->cat_name);
|
|
|
$temp['data']= json_encode($item,JSON_UNESCAPED_UNICODE);
|
|
|
$cgdArr[]=$temp;
|
|
@@ -77,7 +77,7 @@ class caixiao extends Command
|
|
|
echo date('Y-m:d H:i:s').'|'.$item->orderCode."\r\n";
|
|
|
$temp=["order_type"=>1,"uniqkey"=>$unique,"status"=>1,"addtime"=>date('Y-m:d H:i:s')];
|
|
|
if($this->isInCfp($unique)){
|
|
|
- $item['inv_cat_info'] = $this->spuCat($item->good_code,$item->open_type);
|
|
|
+ $item['inv_cat_info'] = OrderTax::spuCat($item->good_code,$item->open_type);
|
|
|
$item['cat_name'] = json_decode($item->cat_name);
|
|
|
$temp["data"]= json_encode($item,JSON_UNESCAPED_UNICODE);
|
|
|
$qrd[]=$temp;
|
|
@@ -90,27 +90,6 @@ class caixiao extends Command
|
|
|
$ist = $this->contect->name("caixiao_data")->where("uniqkey",$unique)->findOrEmpty();
|
|
|
return empty($ist);
|
|
|
}
|
|
|
- /**
|
|
|
-* @param $spuCode
|
|
|
-* @param int $open_type 1 原商品开票 2 子商品开票
|
|
|
-* @param int $order_type 1 进项 2 销项
|
|
|
- * @return array
|
|
|
- */
|
|
|
- protected function SpuCat($spuCode,$open_type=1,$order_type=2){
|
|
|
- $result=[];
|
|
|
- if($open_type==2){
|
|
|
- $goods= GoodCombind::where("spuCode",$spuCode)->select();
|
|
|
- if($goods->isEmpty()) return $result;
|
|
|
- foreach ($goods as $item){
|
|
|
- $temp = GoodTax::getInfobySpuCode($item->spuCode,$order_type);
|
|
|
- if(empty($temp)) continue;
|
|
|
- $result[]=$temp;
|
|
|
- }
|
|
|
- }else{
|
|
|
- $temp = GoodTax::getInfobySpuCode($spuCode,$order_type);
|
|
|
- $result[]=$temp;
|
|
|
- }
|
|
|
- return $result;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
}
|