shish 2 ani în urmă
părinte
comite
a566defa7e
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      app-ghs/controllers/ExpendController.php

+ 4 - 1
app-ghs/controllers/ExpendController.php

@@ -129,7 +129,7 @@ class ExpendController extends BaseController
     public function actionAddExpend()
     {
         $post = Yii::$app->request->post();
-        $type = $post['type'] ?? 0;
+        $type = $post['type'] ?? -1;
         $amount = $post['amount'] ?? 0;
         $remark = $post['remark'] ?? '';
         $bx = $post['bx'] ?? -1;
@@ -139,6 +139,9 @@ class ExpendController extends BaseController
         if ($bx == -1) {
             util::fail('请选报销状态');
         }
+        if ($type == -1) {
+            util::fail('请选择类型');
+        }
         $connection = Yii::$app->db;//事务处理
         $transaction = $connection->beginTransaction();
         try {