Преглед на файлове

Merge branch 'version1.5' into dev_wf

wufeng преди 2 години
родител
ревизия
2ac5874750

+ 13 - 0
app/admin/controller/Base.php

@@ -84,9 +84,22 @@ class Base extends \app\BaseController
                 }
             }
         }
+        /**
+         * 离职交接权限
+         */
+        $resgin= Db::name("resign_info")->where([["hand_uid","=",$this->uid],["is_del","=",0],['status',"=",4]])
+            ->column(['resign_uid']);
+        if(!empty($resgin)){
+            $resgin['write']= array_unique(array_merge($resgin['write'],$resgin));
+        }
+
+        /**
+         * 超级管理员看到所有人的数据
+         */
         if($uid['roleid']==1){
             $action['write']=[];
         }
+
         $action['action_conllect']=implode(",",array_unique(explode(",",$action['action_conllect'])));
         return $action;
     }

+ 10 - 10
app/admin/controller/Check.php

@@ -593,23 +593,23 @@ public function edit()
         }
         $insert=[];
         foreach ($data as $value){
-            if($value["value1"]==""){
-                return error_show(1003,"商品属性code 不能为空");
+            if($value["value0"]==""){
+                return error_show(1003,"商品编号不能为空");
             }
-            if($value["value15"]===""){
+            if($value["value14"]===""){
                 continue;
             }
-            $stock = Db::name("good_stock")->where(["spuCode"=>$value["value1"],"wsm_code"=>$fo['wsm_code'],
-                "is_del"=>0])->find();
+            $stock = Db::name("good_stock")->where(["spuCode"=>$value["value0"],"wsm_code"=>$fo['wsm_code'], "is_del"=>0])->find();
             $stock_num = isset($stock) ? $stock['usable_stock']:0;
             $insert[]=[
-                "spuCode"=>$value["value1"],
-                "good_name"=>$value["value2"],
+                "spuCode"=>$value["value0"],
+                "good_name"=>$value["value1"],
                 "origin_price"=>0,
                 "origin_num"=>isset($stock) ? $stock['usable_stock']:0,
-                "check_num"=>$value["value15"],
-                "is_profit"=>intval($value["value15"])>=$stock_num ?0:1,
-                "diff_num"=>intval($value["value15"])>=$stock_num ?intval($value["value15"])-$stock_num:$stock_num-intval($value["value15"]),
+                "check_num"=>$value["value14"],
+                "is_profit"=>intval($value["value14"])>=$stock_num ?0:1,
+                "diff_num"=>intval($value["value14"])>=$stock_num ?intval($value["value14"])
+                    -$stock_num:$stock_num-intval($value["value14"]),
                 'addtime'=>date("Y-m-d H:i:s"),
                 'updatetime'=>date("Y-m-d H:i:s"),
                 "check_code"=>$fo['check_code']

+ 4 - 1
app/admin/controller/Consult.php

@@ -964,7 +964,9 @@ class Consult extends Base
             $info['sale_price'] =round($price,2);
         }
         $info['specinfo'] = json_decode($info['specinfo'],true);
-
+        $place = ["provice_code"=>"","city_code"=>"","area_code"=>""];
+        list($place['provice_code'],$place['city_code'],$place['area_code'])=explode(",",$info['delivery_place']);
+        $info['delivery_place_cn']=GetAddr(json_encode($place));
         $info['metal_name']=isset($info['metal_id'])&& $info['metal_id']!=0?$this->noble[$info['metal_id']]:"";
         $bargain =Db::name("bargain_order")->where(['bidsNo'=>$bidNo,"is_del"=>0])->find();
         $info['bargain'] =$bargain;
@@ -1603,6 +1605,7 @@ class Consult extends Base
             "num"=>$bidinfoe["num"],
         ];
         $info['gold_price']=0;
+        $info['noble_weight']=$bidinfos['good_weight'];
             if($bidinfos['is_gold_price']==1 &&$bidinfos['metal_id']>0){
                 $gold = Db::name("gold_price1")->where(["type"=>$bidinfos["metal_id"],"is_del"=>0,"status"=>1])->order("addtime desc")
                     ->find();

+ 9 - 3
app/admin/controller/Goodup.php

@@ -950,7 +950,12 @@ class Goodup extends Base
         $data['noble_name']=isset($data['noble_metal'])&&$data['noble_metal']!=0?$this->noble[$data['noble_metal']] :"";
         $data["good_info_img"]=$data['good_info_img']!=""? $data['good_info_img']:'';
         $data["good_img"]=$data['good_img']!=""? $data['good_img']:[];
-        $speclist=[];
+        $gold=[];
+        if ($data['is_gold_price'] == 1) {
+            $gold = Db::name("gold_price1")->where(["type" => $data['noble_metal'], "status" => 1, "is_del" => 0])->order("addtime desc")->find();
+        }
+        $data['gold_price'] =isset($gold["price"])?$gold["price"]:0;
+            $speclist=[];
         if(!empty($spec)){
             foreach ($spec as $value){
                 $temp=[];
@@ -1801,12 +1806,13 @@ class Goodup extends Base
                         $lemp['other_fee'] = $value['other_fee'];
 
                         if ($is_gold_price == 1 && $top_cat_id == 6) {
-                            //$gold =Db::name("gold_price1")->where(["type"=>$noble_metal,"status"=>1,"is_del"=>0])->order("addtime desc")->find();
+                            $gold =Db::name("gold_price1")->where(["type"=>$noble_metal,"status"=>1,"is_del"=>0])->order("addtime desc")->find();
 
                             //$lemp['nake_total'] =$noble_weight*$gold['price'] + $value['cost_fee']*$noble_weight+$value['mark_fee']+$value['package_fee']+$value['cert_fee']+$value['nake_fee']+$value['delivery_fee']+$value['other_fee'];
                             //成本合计=贵金属重量*供应商采购金价 + 工艺费*贵金属重量+加标费+包装费+证书费+成本裸价+运费+其他费用
                             //成本总计启用实时金价时,采用供应商实时金价
-                            $lemp['nake_total'] = $noble_weight * $cgd_gold_price + $value['cost_fee'] * $noble_weight + $value['mark_fee'] + $value['package_fee'] + $value['cert_fee'] + $value['nake_fee'] + $value['delivery_fee'] + $value['other_fee'];
+                            $lemp['nake_total'] =$noble_weight *$gold['price']+ $value['cost_fee'] * $noble_weight +
+                                $value['mark_fee'] + $value['package_fee'] + $value['cert_fee'] + $value['nake_fee'] + $value['delivery_fee'] + $value['other_fee'];
                         }else{
                             $lemp['nake_total'] =$value['nake_fee']+$value['delivery_fee']+$value['cert_fee']+$value['mark_fee']+$value['package_fee']+$value['other_fee'];
                         }

+ 2 - 4
app/admin/controller/Process.php

@@ -7,14 +7,12 @@ use think\App;
 use think\facade\Db;
 
 //流程单
-class Process extends BaseController
+class Process extends Base
 {
-    public $post="";
+
  public function __construct(App $app)
  {
-
      parent::__construct($app);
-     $this->post = $this->request->post();
  }
 
     /**

+ 3 - 21
app/admin/controller/Proorder.php

@@ -2,36 +2,18 @@
 
 namespace app\admin\controller;
 
-use app\BaseController;
 use think\App;
 use think\facade\Db;
 
 //消息(已读未读)
-class Proorder extends BaseController
+class Proorder extends Base
 {
-public $post="";
+
 public function __construct(App $app)
 {
     parent::__construct($app);
-    $this->post=$this->request->post();
 }
-//public function llist(){
-//    $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
-//    $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";
-//    $where =[['c.is_del',"=",0]];
-//    $count = Db::name('process')->alias('a')
-//        ->join("process_order b","b.order_type=a.process_type","left")
-//        ->join("action_process c","c.pid=a.id","left")
-//        ->where($where)->count();
-//    $total = ceil("$count/$size");
-//    $page = $page>$total ? $total:$page;
-//    $list = Db::name('process')->alias('a')
-//        ->join("process_order b","b.order_type=a.process_type","left")
-//        ->join("action_process c","c.pid=a.id","left")
-//        ->field('b.order_type,b.order_code,c.order_name,b.action_process')
-//        ->where($where)->page($page,$size)->order("a.addtime desc")->select();
-//    return app_show(0,"获取成功",['list'=>$list,'count'=>$count]);
-//}
+
 public function list(){
     $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
     $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";

+ 30 - 4
app/admin/model/Workflow.php

@@ -7,17 +7,31 @@ use think\facade\Config;
 //记录操作流程
 class Workflow extends \think\Model
 {
+    public static  $conf=[];
+    public function __construct(array $data = [])
+    {
+        parent::__construct($data);
+        self::$conf=Config::get("process");
+    }
 
     public static function SaveFlow($data){
-        $conf =Config::get("process");
+        $conf =self::$conf;
         $action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
         $last =end($action);
+        $order_status=2;//默认进行中
+        if((is_array($last)&&in_array($data['action_process'],$last))||$last==$data['action_process']){
+            $order_status=3; //流程结束
+        }
+
         $header =reset($action);
+        if((is_array($header)&&in_array($data['action_process'],$header))||$header==$data['action_process']){
+            $order_status=1; //流程新建
+        }
         $proces = self::where(["order_type"=>$data['order_type'],"order_code"=>$data['order_code'],"is_del"=>0])->find();
         if($proces){
             $info=[
                 "order_process"=>$data['order_status'],
-                "order_status"=>$last==$data['action_process']?3:($header==$data['action_process']?1:2),
+                "order_status"=>$order_status,
                 "action_uid"=>$data['action_uid'],
                 "action_name"=>$data['action_name'],
                 "updatetime"=>date("Y-m-d H:i:s")
@@ -29,7 +43,7 @@ class Workflow extends \think\Model
                 "order_code"=>$data['order_code'],
                 "order_id"=>$data['order_id'],
                 "order_process"=>$data['order_status'],
-                "order_status"=>$last==$data['action_process']?3:($header==$data['action_process']?1:2),
+                "order_status"=>$order_status,
                 "apply_id"=>$data['action_uid'],
                 "apply_name"=>$data['action_name'],
                 "action_uid"=>$data['action_uid'],
@@ -39,6 +53,18 @@ class Workflow extends \think\Model
             ];
             self::insert($proces);
         }
-       // self::save($proces);
+
+    }
+
+    /**
+     * 待办事项新建
+     *
+     */
+    public  function  Addwait($data){
+
+    }
+
+    public function checkStatus(){
+
     }
 }