Эх сурвалжийг харах

Merge branch 'wugg-dev' of wugg/phpstock into version1.5

wugg 2 жил өмнө
parent
commit
f91c395852

+ 14 - 6
app/admin/controller/Consult.php

@@ -180,7 +180,12 @@ class Consult extends Base
         if($token==''){
             return error_show(105,"参数token不能为空");
         }
-
+		$pay_id = isset($this->post['pay_id']) && $this->post['pay_id'] !== "" ? intval($this->post['pay_id']) : "0";
+        if($pay_id!=0){
+        	$payinfo =Db::name("pay")->where("id",$pay_id)->findOrEmpty();
+        	if(empty($payinfo)) return error_show(1004, "支付渠道信息未找到");
+        	if($payinfo['status']!=1)return error_show(1004, "支付渠道已禁用");
+        }
         $user =GetUserInfo($token);
         if(empty($user)||$user['code']!=0){
             return error_show(102,"用户数据不存在");
@@ -204,6 +209,7 @@ class Consult extends Base
                 "platform_code"=>$platform_code,
                 "saleid"=>$createrid,
                 "depart"=>isset($depart['itemid'])?$depart['itemid']:0,
+                "pay_id"=>$pay_id,
                 "status"=>0,
                 "is_del"=>0,
                 "addtime"=>date("Y-m-d H:i:s"),
@@ -317,10 +323,12 @@ class Consult extends Base
         }
 
     }
-
-
-    
-
+    /**
+	* @return \think\response\Json|void
+	* @throws \think\db\exception\DataNotFoundException
+	* @throws \think\db\exception\DbException
+	* @throws \think\db\exception\ModelNotFoundException
+    */
     public function zxinfo(){
         $infoNo= isset($this->post['infoNo'])&&$this->post['infoNo']!=""?trim($this->post['infoNo']):"";
         if($infoNo==""){
@@ -357,7 +365,7 @@ class Consult extends Base
         $zxinfo['unit_name']="";
         $zxinfo['metal_name']=isset($zxinfo['metal_id'])&& $zxinfo['metal_id']!=0?$this->noble[$zxinfo['metal_id']]:"";
         $zxinfo['specinfo']=json_decode($zxinfo['specinfo'],true);
-
+		$zxinfo['pay_name'] = $zxorder['pay_id']==0?"":Db::name("pay")->where("id",$zxorder['pay_id'])->value("pay_name",'');
         if($zxorder['khNo']!==""){
             $kh=Db::name("customer_info")->where(['companyNo'=>$zxorder['khNo']])->find();
             $zxinfo['khname']= isset($kh['companyName'])?$kh['companyName']:"";

+ 2 - 24
app/admin/controller/Pay.php

@@ -17,7 +17,7 @@ class Pay extends Base
      */
     public function list()
     {
-    	$param =$this->request->param(["pay_name"=>"","page"=>1,"size"=>10],"post","tirm");
+    	$param =$this->request->param(["pay_name"=>"","page"=>1,"size"=>10],"post","trim");
     	$where=[];
     	if($param['pay_name']!='') $where[]=["pay_name","like","%{$param['pay_name']}%"];
     	$count =Db::name("pay")->where($where)->count();
@@ -114,6 +114,7 @@ class Pay extends Base
 				$temp['weight'] = $key;
 				$temp['status'] = $item['status']??1;
 				$temp['is_del'] =$item['is_del']??0;
+				$temp['updatetime'] =date("Y-m-d H:i:s");
 				$payin = Db::name("pay_rate")->save($temp);
 				if($payin==false) throw new Exception('更新失败');
 			}
@@ -164,27 +165,4 @@ class Pay extends Base
     	$upT =Db::name("pay")->save($isT);
     	return $upT? app_show(0,"状态更新成功"):error_show(1004,"状态更新失败");
     }
-
-    /**
-     * 保存更新的资源
-     *
-     * @param  \think\Request  $request
-     * @param  int  $id
-     * @return \think\Response
-     */
-    public function update(Request $request, $id)
-    {
-        //
-    }
-
-    /**
-     * 删除指定资源
-     *
-     * @param  int  $id
-     * @return \think\Response
-     */
-    public function delete($id)
-    {
-        //
-    }
 }

+ 8 - 1
app/admin/controller/Project.php

@@ -57,6 +57,12 @@ class Project extends Base
         if($ladder==""){
             return error_show(1004,"参数ladder不能为空");
         }
+        $pay_id = isset($this->post['pay_id']) && $this->post['pay_id'] !== "" ? intval($this->post['pay_id']) : "0";
+        if($pay_id!=0){
+        	$payinfo =Db::name("pay")->where("id",$pay_id)->findOrEmpty();
+        	if(empty($payinfo)) return error_show(1004, "支付渠道信息未找到");
+        	if($payinfo['status']!=1)return error_show(1004, "支付渠道已禁用");
+        }
         $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
         if($token==''){
             return error_show(105,"参数token不能为空");
@@ -83,6 +89,7 @@ class Project extends Base
                 "createrid"=>$createrid,
                 "arrtime"=>$arrtime,
                 "endtime"=>$endtime,
+                "pay_id"=>$pay_id,
                 "status"=>1,
                 "is_del"=>0,
                 "addtime"=>date("Y-m-d H:i:s"),
@@ -542,7 +549,7 @@ class Project extends Base
         $info['khName'] = isset($khinfo['companyName'])?$khinfo['companyName']:"";
         $company = Db::name("business")->where(["companyNo"=>$info['companyNo']])->find();
         $info['company'] = isset($company['company'])?$company['company']:"";
-
+        $info['pay_name'] = $info['pay_id']==0?"":Db::name("pay")->where("id",$info['pay_id'])->value("pay_name",'');
         $ladder = Db::name("project_info")->where(['projectNo'=>$projectNo,"is_del"=>0])->select()->toArray();
         $info['ladder']=[];
         if(!empty($ladder)){

+ 8 - 3
app/admin/controller/Sale.php

@@ -53,8 +53,8 @@ class Sale extends Base
         $pay_id = isset($this->post['pay_id']) && $this->post['pay_id'] !== "" ? intval($this->post['pay_id']) : "0";
         if($pay_id!=0){
         	$payinfo =Db::name("pay")->where("id",$pay_id)->findOrEmpty();
-        	if(empty($payinfo)) return error_show(1004, "付款流程信息未找到");
-        	if($payinfo['status']!=1)return error_show(1004, "付款流程信息已禁用");
+        	if(empty($payinfo)) return error_show(1004, "支付渠道信息未找到");
+        	if($payinfo['status']!=1)return error_show(1004, "支付渠道已禁用");
         }
         $sendtype = isset($this->post['sendtype']) && $this->post['sendtype'] !== "" ? intval($this->post['sendtype']) : "";
         if ($sendtype === '') {
@@ -1081,6 +1081,7 @@ class Sale extends Base
                 "zxNo" => $bidNo,
                 "platform_order" => $platform_order,
                 "platform_id" => $zxorder['platform_code'],
+                "pay_id" => $zxorder['pay_id'],
                 "remark" => $remark,
                 "arrive_time" => $arrtime,
                 "is_stock" => 0,
@@ -1401,6 +1402,7 @@ class Sale extends Base
                 $good['pgNo'] = $feedback['pgNo'];
                 $good['platform_id'] = $project['platform_id'];
                 $good['arrtime'] = $arrtime;
+                $good['pay_id'] = $project['pay_id'];
                 $good['rm'] = $rm;
                 $good['ri'] = $ri;
                 $good['send_num'] = 0;
@@ -1645,6 +1647,7 @@ class Sale extends Base
             'good_weight' => $goodinfo['good_weight'],
             'gold_price' => $goodinfo['gold_price'],
             'cost_price' => $goodinfo['sale_cost_fee'],
+            'pay_id' => $good['pay_id'],
             'diff_weight' => 0,
             'diff_fee' => 0,
             "addtime" => date("Y-m-d H:i:s"),
@@ -1937,6 +1940,7 @@ class Sale extends Base
             'good_weight' => $good['noble_weight'],
             'gold_price' => isset($good['cgd_gold_price']) ? $good['cgd_gold_price'] : 0,
             'cost_price' => $goodlass['cost_fee'],
+            'pay_id' => $good['pay_id'],
             'diff_weight' => 0,
             'diff_fee' => 0,
             "addtime" => date("Y-m-d H:i:s"),
@@ -2467,6 +2471,7 @@ class Sale extends Base
         if (empty($einfo)) {
             return error_show(1002, "未找到销售订单数据");
         }
+
         if ($einfo['order_type'] == 3||$einfo['order_type'] == 4) {
             $goon = Db::name("good_zixun")->where(["spuCode" => $einfo['good_code'], "is_del" => 0])->find();
         } else {
@@ -2580,7 +2585,7 @@ class Sale extends Base
         $einfo['good_num'] -= $einfo['th_num'];
         $einfo['send_num'] -= $einfo['th_num'];
         $einfo['total_price'] = round($einfo['total_price'] - $einfo['th_fee'], 2);
-
+		$einfo['pay_name'] = $einfo['pay_id']==0?"":Db::name("pay")->where("id",$einfo['pay_id'])->value("pay_name",'');
         //处理凭证
         if ($einfo['order_type'] == 1 || $einfo['order_type'] == 2) {
             $proof = Db::name('good_proof')

+ 2 - 2
app/admin/route/app.php

@@ -651,5 +651,5 @@ route::rule('filingStatus', 'admin/Filing/status');//审核
 route::rule("payadd","admin/Pay/create");//支付渠道新建
 route::rule("payedit","admin/Pay/save");//支付渠道编辑
 route::rule("paylist","admin/Pay/list");//支付渠道列表
-route::rule("payinfo","admin/Pay/info");//支付渠道新建
-route::rule("paystatus","admin/Pay/status");//支付渠道新建
+route::rule("payinfo","admin/Pay/info");//支付渠道详情
+route::rule("paystatus","admin/Pay/status");//支付渠道状态