qifengquan 1 год назад
Родитель
Сommit
280132b956
2 измененных файлов с 5 добавлено и 4 удалено
  1. 1 1
      app/common.php
  2. 4 3
      app/data/controller/api/business/Purchase.php

+ 1 - 1
app/common.php

@@ -230,7 +230,7 @@ function setword($type,$id){
             ];
             $templateProcessor->setValues($array);
             $name = 'cgdd-'.$id.'-'.time().'.docx';
-            $url = 'http://'.$_SERVER['SERVER_NAME']."/down/".$name;
+            $url = 'https://'.$_SERVER['SERVER_NAME']."/down/".$name;
             $templateProcessor->saveAs($dir2.$name);
             break;
         case 3: case 4:    //生产订单//外协订单

+ 4 - 3
app/data/controller/api/business/Purchase.php

@@ -77,7 +77,7 @@ class Purchase extends Controller
             $validate->failException()->check($item,[
                 'name|名称'=>['require'],
                 'spec|规格'=>['require'],
-                'number|数量'=>['require'],
+                'number|数量'=>['require','integer'],
 //                'standard|验收标准'=>['require'],
 //                'price|价格'=>['require','float'],
             ]);
@@ -187,7 +187,7 @@ class Purchase extends Controller
             $validate->failException()->check($item,[
                 'name|名称'=>['require'],
                 'spec|规格'=>['require'],
-                'number|数量'=>['require'],
+                'number|数量'=>['require','integer'],
                 //  'enclosure|附件'=>['array',],
             ]);
             //            if(!empty($item['enclosure'])){
@@ -372,7 +372,7 @@ class Purchase extends Controller
             $validate->failException()->check($item,[
                 'name|名称'=>['require'],
                 'spec|规格'=>['require'],
-                'number|数量'=>['require'],
+                'number|数量'=>['require','integer'],
                // 'enclosure|附件'=>['array',],
             ]);
 //            if(!empty($item['enclosure'])){
@@ -614,6 +614,7 @@ class Purchase extends Controller
         $model->save();
 
         Db::commit();
+
         $url = setword($data['tab']+1,$data['id']);
         ShopPurchase::getItem($data['tab'])->where('id',$model['id'])->update(['down_word'=>$url]);
         $this->success('匹配成功');