|
|
@@ -180,14 +180,22 @@ class ExpendController extends BaseController
|
|
|
|
|
|
}
|
|
|
$remark = $post['remark'] ?? '';
|
|
|
- $staffName = $this->shopAdmin->name ?? '';
|
|
|
+ $getStaffId = $post['getStaffId'] ?? 0;
|
|
|
+ $staff = ShopAdminClass::getById($getStaffId, true);
|
|
|
+ if (empty($staff)) {
|
|
|
+ util::fail('没有找到员工');
|
|
|
+ }
|
|
|
+ if ($staff->mainId != $this->mainId) {
|
|
|
+ util::fail('没有员工');
|
|
|
+ }
|
|
|
+ $staffName = $staff->name ?? '';
|
|
|
$ptStyle = dict::getDict('ptStyle', 'ghs');
|
|
|
$expendData = [
|
|
|
'type' => $type,
|
|
|
'amount' => $amount,
|
|
|
'remark' => $remark,
|
|
|
'mainId' => $this->mainId,
|
|
|
- 'staffId' => $this->shopAdminId,
|
|
|
+ 'staffId' => $getStaffId,
|
|
|
'staffName' => $staffName,
|
|
|
'ptStyle' => $ptStyle,
|
|
|
'payWay' => $payWay,
|