Commit 34f41845 by 杨树贤

修复bug

parent 7ceaea68
......@@ -42,7 +42,12 @@ class SupplierMemoApiController extends Controller
$this->response(-1,'标题不能为空');
}
if (empty($data['content'])) {
if (strlen($data['title']) > 30) {
$this->response(-1,'标题长度不能超过30个字符串');
}
if (empty(strip_tags($data['content']))) {
$this->response(-1,'内容不能为空');
}
$result = (new SupplierMemoService())->saveSupplierMemo($data);
......
......@@ -1604,9 +1604,9 @@ class DataService
foreach ($suppliers as $supplier) {
$uploadRuler = $supplier['sku_upload_ruler'];
$uploadRuler = json_decode($uploadRuler, true);
$uploadRuler['futures_allow_stock_lte_0'] = 0;
$uploadRuler['futures_allow_stock_lte_0'] = 1;
$uploadRuler['futures_allow_moq_lte_0'] = 0;
$uploadRuler['futures_allow_price_null'] = 0;
$uploadRuler['futures_allow_price_null'] = 1;
$uploadRuler = json_encode($uploadRuler);
SupplierChannelModel::where('supplier_id',$supplier['supplier_id'])->update([
'sku_upload_ruler' => $uploadRuler,
......
......@@ -179,9 +179,11 @@ class SupplierService
$channel = array_except($channel, $contactField);
$channel['channel_uid'] = $contact['can_check_uids'];
$channel['sku_upload_ruler'] = $this->getInitSkuUploadRuler();
//插入供应商返回供应商id
$supplierId = $this->newSupplierId = $model->insertGetId($channel);
$this->saveSkuUploadRulerToRedis($supplierId, $channel['sku_upload_ruler']);
//添加联系人
//要有数据才新增,麻烦得要死
if (!checkArrayAllValueNull($contact)) {
......@@ -419,7 +421,7 @@ class SupplierService
}
//初始化过期天数限制
public function initialCpTimeDays($supplierId,$supplierGroup)
public function initialCpTimeDays($supplierId, $supplierGroup)
{
$cpTimeDay = 7;
$futuresCpTimeDay = 365;
......@@ -829,4 +831,9 @@ class SupplierService
return $supplier;
}
}
\ No newline at end of file
public function getInitSkuUploadRuler()
{
return '{"allow_stock_lte_0":0,"allow_moq_lte_0":0,"allow_stock_lt_moq":0,"allow_price_null":0,"futures_allow_stock_lte_0":1,"futures_allow_moq_lte_0":0,"futures_allow_price_null":1}';
}
}
......@@ -63,7 +63,7 @@
let id = data.id;
layer.open({
type: 2,
content: '/supplier_memo/SaveSupplierMemo?view=iframe&id=' + id,
content: '/supplier_memo/SaveSupplierMemo?view=iframe&id=' + id + '&supplier_id=' + supplierId,
area: ['80%', '80%'],
title: '修改备忘',
end: function () {
......
......@@ -18,6 +18,8 @@
value="{{$memo['title'] or ''}}">
</div>
</div>
<input type="hidden" name="id" id="id" value="{{$memo['id'] or ''}}">
{{-- <input type="hidden" name="supplier_id" id="supplier_id" value="{{$memo['supplier_id'] or ''}}">--}}
<div class="layui-form-item">
<label class="layui-form-label"><span class="require">*</span>内容 : </label>
<div class="layui-input-block block-42">
......
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