Commit 87c2c41e by 杨树贤

fix

parent 57bfa062
......@@ -75,6 +75,7 @@ class SupplierRecallMailRemind extends Command
} else {
$searchResult = [];
}
if (empty($searchResult)) {
continue;
}
......@@ -99,8 +100,13 @@ class SupplierRecallMailRemind extends Command
// 采购经理
$manager = null;
if (!empty($purchaseUser->department_id)) {
$departmentIds = DB::table('department')
->where('parent', $purchaseUser->department_id)
->orWhere('departmentId', $purchaseUser->department_id)
->pluck('departmentId')
->toArray();
$manager = DB::table('user_info')
->where('department_id', $purchaseUser->department_id)
->whereIn('department_id', $departmentIds)
->where('position_name', '采购经理')
->first();
if ($manager && !empty($manager->email)) {
......@@ -108,7 +114,7 @@ class SupplierRecallMailRemind extends Command
}
// 采购总监
$director = DB::table('user_position')
->where('department_id', $purchaseUser->department_id)
->whereIn('department_id', $departmentIds)
->where('position_name', '采购总监')
->first();
if ($director) {
......
......@@ -59,6 +59,7 @@ class SupplierContractController extends Controller
$contract = $model->with('supplier')->where('id', $id)->first()->toArray();
$contract['start_time'] = date('Y-m-d H:i:s', $contract['start_time']);
$contract['end_time'] = date('Y-m-d H:i:s', $contract['end_time']);
$contract['recall_time'] = $contract['recall_time'] ? date('Y-m-d H:i:s', $contract['recall_time']) : '';
$this->data['contract'] = $contract;
}
$this->data['supplierList'] = $supplierList;
......
......@@ -33,6 +33,7 @@ class SupplierContractService
try {
\DB::connection('web')->beginTransaction();
$data['end_time'] = strtotime($data['end_time']);
$data['recall_time'] = strtotime($data['recall_time']);
// 检查是否已存在相同供应商的合同
if (empty($data['id'])) {
......@@ -61,6 +62,7 @@ class SupplierContractService
'end_time' => '合同有效期',
'commission_rate' => '抽佣比率',
'check_date' => '对账日期',
'recall_time' => '召回期',
];
$diffArr = [];
$oldData = $oldData->toArray();
......@@ -124,7 +126,7 @@ class SupplierContractService
} catch (\Exception $e) {
\DB::connection('web')->rollBack();
\Log::error(json_encode($e->getMessage()) . ' ' . $e->getLine());
return $e->getMessage();
return $e->getMessage().' '.$e->getLine();
}
}
......
......@@ -42,7 +42,7 @@
<label class="layui-form-label"><span class="require">*</span>召回期</label>
<div class="layui-input-inline" style="width: 150px;">
<input type="text" name="recall_time" id="recall_time" placeholder="召回期" class="layui-input"
autocomplete="off" value="{{ $contract['recall_time'] or '' }}">
autocomplete="off" value="{{ $contract['recall_time']===0?'':$contract['recall_time'] }}">
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment