wugg 1 anno fa
parent
commit
65f5e3ab0c
2 ha cambiato i file con 17 aggiunte e 30 eliminazioni
  1. 10 30
      app/bbc/controller/Good.php
  2. 7 0
      app/bbc/route/app.php

+ 10 - 30
app/bbc/controller/Good.php

@@ -28,7 +28,7 @@ class Good extends Base
             'createrid' => '',
             'status' => '',
             'platform_code' => '',
-            'platform_type' => 1,
+            'platform_type' => 2,
             'plat_code' => '',
             'exam_status' => '',
             'brand_id' => '',
@@ -60,7 +60,7 @@ class Good extends Base
         if ($param['create_source'] !== '') $where[] = ['a.create_source', '=', $param['create_source']];
         if ($param['is_compliance'] !== '') $where[] = ['b.is_compliance', '=', $param['is_compliance']];
         if ($param['brand_id'] !== '') $where[] = ['a.brand_id', '=', $param['brand_id']];
-        if($param['platform_type'] == ''){
+        if($param['platform_type'] !== ''){
             $platfromId = $platfrom->where(['platform_type'=>$param['platform_type'],'is_del'=>0])->column('id');
             $where[] = ['b.platform_id', 'in', $platfromId ];
         }
@@ -120,12 +120,12 @@ class Good extends Base
         $platform = $goodPlat->where(['skuCode'=>$post['skuCode'],'is_del'=>0])->findOrEmpty();
         if($platform->isEmpty()) $this->error('未找到商品数据');
         
-//         if($platform->is_fixed==1){
-//        	//使用实时金价
-//        	 $nake=$goodNake->where(['spuCode'=> $platform->spuCode,'is_del'=>0,'nake_fee'=>0])
-//        	 ->findOrEmpty();
-//        	 if($nake->isEmpty()) $this->error('一口价商品请先完善商品成本单价');
-//        }
+         if($platform->is_fixed==1){
+        	//使用实时金价
+        	 $nake=$goodNake->where(['spuCode'=> $platform->spuCode,'is_del'=>0,'nake_fee'=>0])
+        	 ->findOrEmpty();
+        	 if($nake->isEmpty()) $this->error('一口价商品请先完善商品成本单价');
+        }
         if($post['exam_status']==3){
             $is_exit = $goodPlat
                 ->where(['plat_code' =>$post['plat_code'],'is_del' =>0, 'exam_status' =>3])//bbc商品编号唯一不可重复
@@ -158,28 +158,6 @@ class Good extends Base
                 ];
                 $inr=(new GoodExam())->save($data);
                 if($inr){
-                	$event=[];
-//					 ActionLog::logAdd(['id' => $createrid, 'nickname' => $creater], [
-//                        'order_code' => $platform['skuCode'],//编号
-//                        'status' => $before,
-//                        'action_remark' => '',//备注
-//                        'action_type' => 'status'//新建create,编辑edit,更改状态status
-//                    ], 'SPSX', $post['exam_status'], $platform);
-//
-                    //如果是商品下线的话,记入商品下线记录表
-                    if ($post['exam_status'] == 5) {
-                    
-//                        $offline_id = Db::name('good_offline_log')->insertGetId([
-//                            'spuCode' => $platform['spuCode'],
-//                            'skuCodes' => $platform['skuCode'],
-//                            'good_name' => Db::name('good_basic')->where('spuCode', $platform['spuCode'])->value('good_name', ''),
-//                            'offline_reason' => $post['offline_reason'],
-//                            'offline_remark' => $post['offline_remark'],
-//                            'createrid' => $createrid,
-//                            'creater' => $creater,
-//                            'addtime' => date('Y-m-d H:i:s'),
-//                        ]);
-                    }
                     if ($post['exam_status'] == 3) {
                     	//todo::需要去掉;
                     	if($post['proof_url']!=''){
@@ -220,6 +198,7 @@ class Good extends Base
                 }else throw new Exception('商品审核失败');
             }else throw new Exception('商品审核失败');
                     $platform->commit();
+                    //流程记录
                     $event=[ 'order_type' => 'SPSX',
                         'order_code' =>$platform->skuCode,//咨询单详情编号
                         'order_id' => $platform->id,
@@ -231,6 +210,7 @@ class Good extends Base
                         ];
                    event('ProcessOrder',$event);
                    if($post['exam_status']==5){
+                   	//下线记录
                    	$enevt=[
                    		    'spuCode' => $platform->spuCode,
                             'skuCodes' => $platform->skuCode,

+ 7 - 0
app/bbc/route/app.php

@@ -0,0 +1,7 @@
+<?php
+
+use think\facade\Route;
+
+route::rule('goodList', 'bbc/Good/list');
+route::rule('goodExam', 'bbc/Good/exam');
+