wugg 5 ماه پیش
والد
کامیت
8daacaeaa7
5فایلهای تغییر یافته به همراه26 افزوده شده و 49 حذف شده
  1. 3 30
      app/admin/controller/Action.php
  2. 5 6
      app/admin/controller/Goodup.php
  3. 7 4
      app/admin/controller/Sale.php
  4. 1 0
      app/txx/command/updateAct.php
  5. 10 9
      app/txx/controller/Activity.php

+ 3 - 30
app/admin/controller/Action.php

@@ -12,34 +12,7 @@ use think\App;
 class Action extends BaseController
 class Action extends BaseController
 {
 {
 
 
-    /**
-     * public function __construct(App $app)
-     * {
-     * parent::__construct($app);
-     * $post  =$this->request->post();
-     * $token = isset($post['token']) ? trim($post['token']) : "";
-     * if($token==""){
-     * return json_show(101,'token不能为空');
-     *
-     * }
-     * $effetc = VerifyTokens($token);
-     * if(!empty($effetc) && $effetc['code']!=0){
-     * return json_show($effetc['code'],$effetc['message']);
-     *
-     * }
-     * }
-     * public function ActionList(){
-     * $post  =$this->request->post();
-     * $pageid = isset($post['id']) ? intval($post['id']) : "";
-     * if($pageid==""){
-     * return json_show(1001,'页面id不能为空');
-     * }
-     * $condition = ['menuid'=>$pageid];
-     * $data=Db::name('action')->alias("a")->leftJoin("action_list l","a.action_code=l.action_code")->field
-     * ("a.*,action_name")->where($condition)->select();
-     * return json_show(0,"获取成功",$data);
-     * }
-     */
+
     public function ActionSave()
     public function ActionSave()
     {
     {
 
 
@@ -114,7 +87,7 @@ class Action extends BaseController
                 ->alias("a")
                 ->alias("a")
                 ->leftJoin("action_list l", "a.action_code=l.action_code")
                 ->leftJoin("action_list l", "a.action_code=l.action_code")
                 ->field("a.*,action_name")
                 ->field("a.*,action_name")
-                ->where(['a.menuid' => $value['id'], "a.status" => 1])
+                ->where(['a.menuid' => $value['id'], "a.status" => 1, 'a.is_del' =>0])
                 ->select()
                 ->select()
                 ->toArray();
                 ->toArray();
             $value['action'] = $act;
             $value['action'] = $act;
@@ -134,7 +107,7 @@ class Action extends BaseController
         if($pageid==""){
         if($pageid==""){
             return error_show(1001,'页面id不能为空');
             return error_show(1001,'页面id不能为空');
         }
         }
-        $condition = ['menuid'=>$pageid];
+        $condition = ['menuid'=>$pageid,'a.is_del' =>0];
         $data=Db::name('action')
         $data=Db::name('action')
             ->alias("a")
             ->alias("a")
             ->leftJoin("action_list l","a.action_code=l.action_code")
             ->leftJoin("action_list l","a.action_code=l.action_code")

+ 5 - 6
app/admin/controller/Goodup.php

@@ -101,8 +101,8 @@ class Goodup extends Base
         }
         }
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']) :"";
         $status = isset($this->post['status']) && $this->post['status'] !=="" ? intval($this->post['status']) :"";
         if($status!==""){
         if($status!==""){
-            $where[]=['gb.status',"=",$status];
-            $condit[]=['a.status',"=",$status];
+            $where[]=['gb.status',"in",$status];
+            $condit[]=['a.status',"in",$status];
         }
         }
         $is_stock = isset($this->post['is_stock']) && $this->post['is_stock'] !== "" ? intval($this->post['is_stock']) : '';
         $is_stock = isset($this->post['is_stock']) && $this->post['is_stock'] !== "" ? intval($this->post['is_stock']) : '';
         if ($is_stock!=='') {
         if ($is_stock!=='') {
@@ -175,9 +175,6 @@ class Goodup extends Base
         $unit = Db::name('unit')
         $unit = Db::name('unit')
             ->where(['id'=>array_column($list,'good_unit')])
             ->where(['id'=>array_column($list,'good_unit')])
             ->column('unit','id');
             ->column('unit','id');
-
-//        $supplierInfo = $userCommon->handle('getCodeAndName',['code'=>array_merge(array_column($list,'companyNo'),array_column($list,'supplierNo'))]);
-
         foreach ($list as $value){
         foreach ($list as $value){
                 $value["cat_info"]= made($value['cat_id'],[]);
                 $value["cat_info"]= made($value['cat_id'],[]);
 //                $brand=Db::name("brand")->where(["id"=>$value['brand_id']])->find();
 //                $brand=Db::name("brand")->where(["id"=>$value['brand_id']])->find();
@@ -190,7 +187,9 @@ class Goodup extends Base
                 $value['supplier_name']=$value['supplierName'];//$supplierInfo['data'][$value['supplierNo']]??'';//isset($supplier['name'])?$supplier['name']:"";
                 $value['supplier_name']=$value['supplierName'];//$supplierInfo['data'][$value['supplierNo']]??'';//isset($supplier['name'])?$supplier['name']:"";
                 $value['exclusive']=makeExcluse($value['is_exclusive']);
                 $value['exclusive']=makeExcluse($value['is_exclusive']);
                 $value['noble_name']=isset($value['noble_metal'])&&$value['noble_metal']!=0?$this->noble[$value['noble_metal']] :"";
                 $value['noble_name']=isset($value['noble_metal'])&&$value['noble_metal']!=0?$this->noble[$value['noble_metal']] :"";
-
+                $value['tax_info']=$value['tax_info']= GoodTax::with(['Tax'])
+                                            ->where(['spuCode' => $value['spuCode']])
+                                    ->visible(['in_tax_name', 'in_tax_code', 'in_tax_short', 'in_tax_merge', 'tax'])->findOrEmpty();
             //如果一个spucode在任意平台上线,那么就视为它上线,即手动把它的is_online值改为1
             //如果一个spucode在任意平台上线,那么就视为它上线,即手动把它的is_online值改为1
            $value['is_online'] = 0;
            $value['is_online'] = 0;
             if (isset($exam_statuss[$value['spuCode']]) || isset($exam_status_yz[$value['spuCode']])) $value['is_online'] = 1;
             if (isset($exam_statuss[$value['spuCode']]) || isset($exam_status_yz[$value['spuCode']])) $value['is_online'] = 1;

+ 7 - 4
app/admin/controller/Sale.php

@@ -4845,23 +4845,26 @@ class Sale extends Base
 
 
         $i = 1;
         $i = 1;
         $send_type = [1 => '直接发货', 2 => '延时发货'];
         $send_type = [1 => '直接发货', 2 => '延时发货'];
-        $status = [0 => '待发货', 1 => '待库管发货', 2 => '已发货待收货', 3 => '已收货', 4 => '已全部退货'];
+        $status = [0 => '待发货', 1 => '待库管发货', 2 => '已发货待收货', 3 => '已收货', 4 => '已全部退货', 5 => '取消发货单'];
+        $Cgdstatus = [0 => '待与供应商确认', 1 => '待入库', 2 => '部分入库', 3 => '入库完成', 4 => '取消采购单'];
         $list = Db::name("order_out")
         $list = Db::name("order_out")
             ->alias('a')
             ->alias('a')
             ->field('"" as 序号,a.addtime as 创建时间,po.cgdNo as 采购单编号,po.status as 采购单状态,po.cgder as 采购员,b.orderCode as 确认单号,b.addtime as 确认单时间,
             ->field('"" as 序号,a.addtime as 创建时间,po.cgdNo as 采购单编号,po.status as 采购单状态,po.cgder as 采购员,b.orderCode as 确认单号,b.addtime as 确认单时间,
             b.good_code as 产品编号,b.skuCode as 商品上线编码,"" 平台商品编码,b.good_name as 产品名称,"" as 规格,"" as 单位,b.supName as 供应商名称,b.supNo as 供应商编号,
             b.good_code as 产品编号,b.skuCode as 商品上线编码,"" 平台商品编码,b.good_name as 产品名称,"" as 规格,"" as 单位,b.supName as 供应商名称,b.supNo as 供应商编号,
-            a.post_fee as 物流费,b.send_type as 发货方式,b.remark as 确认单备注,po.good_num as 采购数量,a.send_num 发货数量,
+            a.post_fee as 物流费,b.send_type as 发货方式,b.remark as 确认单备注,po.good_num as 采购数量,a.send_num 发货数量,a.status 发货单状态,
             oa.contactor as 收货人,oa.mobile as 联系方式,oa.addr as 收货地址,oa.addr_code,oa.arrive_time as 到货时间,a.outCode as 发货申请单号,po.order_type,
             oa.contactor as 收货人,oa.mobile as 联系方式,oa.addr as 收货地址,oa.addr_code,oa.arrive_time as 到货时间,a.outCode as 发货申请单号,po.order_type,
             b.platform_order 平台订单号,a.post_name 发货申请单物流公司,a.post_code 发货申请单物流单号,a.post_fee 发货申请单物流费用,a.remark 发货申请单备注,a.apply_name 申请人,b.cat_id 商品分类')
             b.platform_order 平台订单号,a.post_name 发货申请单物流公司,a.post_code 发货申请单物流单号,a.post_fee 发货申请单物流费用,a.remark 发货申请单备注,a.apply_name 申请人,b.cat_id 商品分类')
             ->whereIn('a.outCode', $outCodes)
             ->whereIn('a.outCode', $outCodes)
             ->order("a.addtime desc")
             ->order("a.addtime desc")
             ->withAttr('序号', function () use (&$i) {
             ->withAttr('序号', function () use (&$i) {
                 return $i++;
                 return $i++;
-            })->withAttr('采购单状态', function ($val) use ($status) {
+            })->withAttr('发货单状态', function ($val) use ($status) {
                 return isset($status[$val]) ? $status[$val] : '';
                 return isset($status[$val]) ? $status[$val] : '';
             })->withAttr('发货方式', function ($val) use ($send_type) {
             })->withAttr('发货方式', function ($val) use ($send_type) {
                 return isset($send_type[$val]) ? $send_type[$val] : '';
                 return isset($send_type[$val]) ? $send_type[$val] : '';
-            })->where("a.is_del", "=", 0)
+            })->withAttr('采购单状态', function ($val) use ($Cgdstatus) {
+                return isset($Cgdstatus[$val]) ? $Cgdstatus[$val] : '';
+             })->where("a.is_del", "=", 0)
             ->leftJoin("sale b", "b.orderCode=a.orderCode")
             ->leftJoin("sale b", "b.orderCode=a.orderCode")
             ->leftJoin("order_addr oa", "oa.id=a.addrid AND oa.is_del=0")
             ->leftJoin("order_addr oa", "oa.id=a.addrid AND oa.is_del=0")
             ->leftJoin('order_send os', 'os.outCode=a.outCode ')
             ->leftJoin('order_send os', 'os.outCode=a.outCode ')

+ 1 - 0
app/txx/command/updateAct.php

@@ -35,6 +35,7 @@ class updateAct extends Command
                 $info->save();
                 $info->save();
             }elseif($info->promocode_status==1){
             }elseif($info->promocode_status==1){
                 $info->status=6; //同步中
                 $info->status=6; //同步中
+                $info->remark='';
                 $info->save();
                 $info->save();
             }else{
             }else{
                 $info->status=5;
                 $info->status=5;

+ 10 - 9
app/txx/controller/Activity.php

@@ -178,20 +178,21 @@ class Activity extends Base{
         if(!in_array($info->status,[4,5]))throw new \Exception("状态有误");
         if(!in_array($info->status,[4,5]))throw new \Exception("状态有误");
 
 
         try{
         try{
-           if($info->promocode_id!==0){
+           if($info->promocode_id!=0){
+             $info->status=2;
             $promocode= \app\youzan\model\YzActivityPromoCode::where(["is_del"=>0,"id"=>$info->promocode_id])->findOrEmpty();
             $promocode= \app\youzan\model\YzActivityPromoCode::where(["is_del"=>0,"id"=>$info->promocode_id])->findOrEmpty();
-            if($promocode->isEmpty()){
-                 $info->promocode_id=0;
-                 $info->status=1;
-            }else {
-                $promocode->save(['status'=>0]);
+            if(!$promocode->isEmpty()){
+                $promocode->save(['status'=>0,"remark"=>"重试生成券码"]);
                 $info->remark="重试生成券码";
                 $info->remark="重试生成券码";
+            }else{
+                $info->promocode_id=0;
+                $info->status=1;
             }
             }
 
 
         }else{
         }else{
-            $info->promocode_id=0;
-            $info->status=1;
-        }
+               $info->promocode_id=0;
+               $info->status=1;
+           }
         $save= $info->save();
         $save= $info->save();
         if(!$save)throw new \Exception('重置失败');
         if(!$save)throw new \Exception('重置失败');
         }catch (\Exception $e){
         }catch (\Exception $e){