|
@@ -68,6 +68,14 @@ class JiesuanController extends CatchController
|
|
|
'tixian_money' => 'required|numeric|min:500'
|
|
|
]);
|
|
|
$company_uid = $this->getLoginUserId();
|
|
|
+ $now = date('Y-m-d H:i:s');
|
|
|
+
|
|
|
+ if(DB::table('tixian_records')->where(['company_uid' => $company_uid])
|
|
|
+ ->where('created_at', '>=', date('Y-m-d'))
|
|
|
+ ->where('created_at', '<=', $now)
|
|
|
+ ->exists()) {
|
|
|
+ CommonBusinessException::throwError(Errors::TIXIAN_ONLY_ONCE_EVERY_DAY);
|
|
|
+ }
|
|
|
$tixianMoney = $request->input('tixian_money');
|
|
|
$userMoneyInfo = CompanyUserMoneyService::userMoneyInfo($company_uid);
|
|
|
if($tixianMoney > $userMoneyInfo->yue_money) {
|
|
@@ -78,7 +86,6 @@ class JiesuanController extends CatchController
|
|
|
if(!$bankCard) {
|
|
|
CommonBusinessException::throwError(Errors::BANK_CARD_STATUS_ERROR);
|
|
|
}
|
|
|
- $now = date('Y-m-d H:i:s');
|
|
|
DB::table('tixian_records')
|
|
|
->insert([
|
|
|
'tixian_money' => $tixianMoney,
|