|
@@ -24,7 +24,7 @@ class SupplierService extends Service
|
|
|
|
|
|
$model = Supplier::where('id',$data['id'])->first();
|
|
|
$model->title = $data['title'];
|
|
|
- $model->code = $data['code'];
|
|
|
+ $model->code = $data['code'] ?? "";
|
|
|
$model->address1 = ! empty($data['address1']) ? json_encode($data['address1']) : '';
|
|
|
$model->address2 = $data['address2'] ?? '';
|
|
|
$model->mark = $data['mark'] ?? '';
|
|
@@ -55,7 +55,7 @@ class SupplierService extends Service
|
|
|
|
|
|
$model = new Supplier();
|
|
|
$model->title = $data['title'];
|
|
|
- $model->code = $data['code'];
|
|
|
+ $model->code = $data['code'] ?? "";
|
|
|
$model->mobile = $data['mobile'] ?? "";
|
|
|
$model->address1 = ! empty($data['address1']) ? json_encode($data['address1']) : '';
|
|
|
$model->address2 = $data['address2'] ?? '';
|
|
@@ -171,7 +171,7 @@ class SupplierService extends Service
|
|
|
*/
|
|
|
public function customerRule(&$data, $user, $is_add = true){
|
|
|
if(empty($data['title'])) return [false,'供应商名称不能为空'];
|
|
|
- if(empty($data['code'])) return [false,'供应商编码不能为空'];
|
|
|
+// if(empty($data['code'])) return [false,'供应商编码不能为空'];
|
|
|
|
|
|
//所属部门 以及 顶级部门
|
|
|
if(empty($data['depart_id'])) {
|