Commit 87c2c41e by 杨树贤

fix

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