|
|
@@ -0,0 +1,29 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace ghs\controllers;
|
|
|
+
|
|
|
+use bizGhs\expend\classes\ExpendClass;
|
|
|
+use common\components\dict;
|
|
|
+use common\components\util;
|
|
|
+use Yii;
|
|
|
+
|
|
|
+class ExpendController extends BaseController
|
|
|
+{
|
|
|
+
|
|
|
+ //新增支出 ssh 20220710
|
|
|
+ public function actionAddExpend()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $type = $post['type'] ?? dict::getDict('expendType', 'hs');
|
|
|
+ $amount = $post['amount'] ?? 0;
|
|
|
+ if (is_numeric($amount) == false || $amount <= 0) {
|
|
|
+ util::fail('请输入正确的金额');
|
|
|
+ }
|
|
|
+ $remark = $post['remark'] ?? '';
|
|
|
+ $staffName = $this->shopAdmin->name ?? '';
|
|
|
+ $data = ['type' => $type, 'amount' => $amount, 'remark' => $remark, 'mainId' => $this->mainId, 'staffId' => $this->shopAdminId, 'staffName' => $staffName];
|
|
|
+ ExpendClass::add($data);
|
|
|
+ util::complete();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|