Browse Source

Merge branch 'version1.5' of http://120.46.155.214:3000/wugg/phpstock into version1.5

wugg 2 years ago
parent
commit
058467cb92

+ 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;
     }

+ 3 - 2
app/admin/controller/Consult.php

@@ -651,7 +651,7 @@ class Consult extends Base
         $cost_desc = isset($this->post['cost_desc'])&&$this->post['cost_desc']!=""? trim($this->post['cost_desc']):"";
         $work_day = isset($this->post['work_day'])&&$this->post['work_day']!=""? intval($this->post['work_day']):"";
         $delivery_day = isset($this->post['delivery_day'])&&$this->post['delivery_day']!=""? intval($this->post['delivery_day']):"";
-        $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? trim($this->post['good_img']):"";
+        $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? $this->post['good_img']:[];
         $expire_day = isset($this->post['expire_day'])&&$this->post['expire_day']!=""? intval($this->post['expire_day'])
             :"";
         $origin_place = isset($this->post['origin_place'])&&$this->post['origin_place']!=""? trim($this->post['origin_place']):"";
@@ -1023,7 +1023,7 @@ class Consult extends Base
         $cost_desc = isset($this->post['cost_desc'])&&$this->post['cost_desc']!=""? trim($this->post['cost_desc']):"";
         $work_day = isset($this->post['work_day'])&&$this->post['work_day']!=""? intval($this->post['work_day']):"";
         $delivery_day = isset($this->post['delivery_day'])&&$this->post['delivery_day']!=""? intval($this->post['delivery_day']):"";
-        $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? trim($this->post['good_img']):"";
+        $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? $this->post['good_img']:[];
         $expire_day = isset($this->post['expire_day'])&&$this->post['expire_day']!=""? intval($this->post['expire_day'])
             :"";
         $origin_place = isset($this->post['origin_place'])&&$this->post['origin_place']!=""? trim($this->post['origin_place']):"";
@@ -1603,6 +1603,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();

+ 18 - 4
app/admin/controller/Goodup.php

@@ -880,6 +880,14 @@ class Goodup extends Base
             if($data['status']==3 && $status==1){
                 $online = Db::name("good_platform")->where(["spuCode"=>$supcode,"is_online"=>0,"status"=>0, "is_del"=>0])->save(["is_online"=>0,"exam_status"=>2,"updatetime"=>date("Y-m-d H:i:s")]);
             }
+
+            if ($status == 1) {
+                //把同一个spuCode,且状态为1待完善成本,的记录更改状态为2待产品审核
+                Db::name('good')
+                    ->where(['is_del' => 0, 'status' => 1])
+                    ->whereIn('spuCode', $supcode)
+                    ->update(['status' => 2, 'updatetime' => date('Y-m-d H:i:s')]);
+            }
             $data['status']=$status;
             $data['updatetime']=date("Y-m-d H:i:s");
             $up= Db::name("good_basic")->save($data);
@@ -942,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=[];
@@ -1793,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'];
                         }
@@ -1976,7 +1990,7 @@ class Goodup extends Base
                 "online_remark" => $param['online_remark'],
                 "exam_status" => isset($all_nakes[$value]) ? ($all_nakes[$value] > 0 ? 2 : 1) : 1,
                 "is_online" => 0,
-                "status" => 1,
+                "status" => 0,
                 "is_del" => 0,
                 "creater" => $creater,
                 "createrid" => $createrid,

+ 20 - 0
app/admin/controller/Sale.php

@@ -3541,4 +3541,24 @@ class Sale extends Base
         $headerArr = array_keys($list[0]);
         excelSave('发货申请单导出' . date('YmdHis'), $headerArr, $list);
     }
+
+    //发货申请单 签收(目前只改动状态,后面要实时查询物流信息,以判断是否签收)
+    public function saleoutReceipt()
+    {
+
+        $outCode = $this->request->post('outCode', '', 'trim');
+
+        if (empty($outCode)) return error_show(1004, '发货申请单编号不能为为空');
+
+        $rs = Db::name('order_out')
+            ->field('id')
+            ->where(['outCode' => $outCode, 'status' => 2])
+            ->find();
+
+        if (empty($rs)) return error_show(1005, '该出库单不存在或不允许确认收货');
+        else return Db::name('order_out')->field('id')->where(['id' => $rs['id'], 'status' => 2])->update(['status' => 3, 'updatetime' => date('Y-m-d H:i:s')]) ? app_show(0, '收货完成') : error_show(1005, '收货失败');
+    }
+
+
+
 }

+ 1 - 0
app/admin/route/app.php

@@ -104,6 +104,7 @@ Route::rule('salegetprice','admin/Sale/getPrice');
 Route::rule('goodzxinfo','admin/Sale/goodzxinfo');
 Route::rule('getgoodzxinfobynotzixun','admin/Sale/getGoodZxInfoByNotZixun');
 Route::rule('exportsaleout','admin/Sale/exportSaleOut');//发货申请单导出
+Route::rule('saleoutreceipt','admin/Sale/saleoutReceipt');//发货申请单确认收货
 
 Route::rule('checkflist','admin/Check/flist');
 Route::rule('checklist','admin/Check/list');