定价不能修改
This commit is contained in:
parent
facb030816
commit
d4bb8305b2
@ -25,7 +25,7 @@ class CompanySync extends Command
|
|||||||
'update_time as updated_at',
|
'update_time as updated_at',
|
||||||
'del'
|
'del'
|
||||||
])->get()->toArray();
|
])->get()->toArray();
|
||||||
|
|
||||||
foreach ($data as &$item) {
|
foreach ($data as &$item) {
|
||||||
$item = (array)$item;
|
$item = (array)$item;
|
||||||
$item['sn'] = CommonService::stringifyCompanyId($item['id']);
|
$item['sn'] = CommonService::stringifyCompanyId($item['id']);
|
||||||
@ -34,7 +34,7 @@ class CompanySync extends Command
|
|||||||
$item['deleted_at'] = $item['del'] ? $item['updated_at'] : null;
|
$item['deleted_at'] = $item['del'] ? $item['updated_at'] : null;
|
||||||
unset($item['del']);
|
unset($item['del']);
|
||||||
}
|
}
|
||||||
|
|
||||||
Company::upsert($data, 'id');
|
Company::upsert($data, 'id');
|
||||||
|
|
||||||
app(CompanyRepository::class)->forgetCached();
|
app(CompanyRepository::class)->forgetCached();
|
||||||
|
@ -48,7 +48,7 @@ class ProductSync extends Command
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Product::upsert($products, ['sn', 'deleted_at']);
|
Product::upsert($products, ['sn', 'deleted_at'], true);
|
||||||
|
|
||||||
app(ProductRepository::class)->forgetCached();
|
app(ProductRepository::class)->forgetCached();
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class ProductService extends Service
|
|||||||
$item->base_price = sprintf('%.02f', $item->base_price/100);
|
$item->base_price = sprintf('%.02f', $item->base_price/100);
|
||||||
$item->renewal_price = sprintf('%.02f', $item->renewal_price/100);
|
$item->renewal_price = sprintf('%.02f', $item->renewal_price/100);
|
||||||
});
|
});
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ class ProductService extends Service
|
|||||||
|
|
||||||
$this->productRepository->setModel($node)->update($attributes);
|
$this->productRepository->setModel($node)->update($attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<li class="ui-list">
|
<li class="ui-list">
|
||||||
<div class="ui-list-title">基础价格</div>
|
<div class="ui-list-title">基础价格</div>
|
||||||
<div class="ui-list-content">
|
<div class="ui-list-content">
|
||||||
<InputNumber :active-change="false" :max="100000" :min="0" :precision="2" :step="0.1" v-model.trim="params.base_price"></InputNumber>
|
<InputNumber :disabled="isUpdate" :active-change="false" :max="100000" :min="0" :precision="2" :step="0.1" v-model.trim="params.base_price"></InputNumber>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
2
public/js/app.8e362ad0.js
Normal file
2
public/js/app.8e362ad0.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/app.8e362ad0.js.map
Normal file
1
public/js/app.8e362ad0.js.map
Normal file
File diff suppressed because one or more lines are too long
2
public/js/chunk-bd098298.3ff3f69c.js
Normal file
2
public/js/chunk-bd098298.3ff3f69c.js
Normal file
File diff suppressed because one or more lines are too long
1
public/js/chunk-bd098298.3ff3f69c.js.map
Normal file
1
public/js/chunk-bd098298.3ff3f69c.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-bd098298.36d75fd0.css rel=prefetch><link href=/js/chunk-00ae0766.9e6b7bf3.js rel=prefetch><link href=/js/chunk-bd098298.8011ee29.js rel=prefetch><link href=/css/app.36043160.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.5a1c2656.js rel=preload as=script><link href=/js/chunk-vendors.02a4e5bc.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.36043160.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.02a4e5bc.js></script><script src=/js/app.5a1c2656.js></script></body></html>
|
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-bd098298.36d75fd0.css rel=prefetch><link href=/js/chunk-00ae0766.9e6b7bf3.js rel=prefetch><link href=/js/chunk-bd098298.3ff3f69c.js rel=prefetch><link href=/css/app.36043160.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.8e362ad0.js rel=preload as=script><link href=/js/chunk-vendors.02a4e5bc.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.36043160.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.02a4e5bc.js></script><script src=/js/app.8e362ad0.js></script></body></html>
|
@ -20,7 +20,7 @@ class PostgresGrammar extends Grammar
|
|||||||
public function compileUpdateBatch(QueryBuilder $query, array $values, $filed = 'id')
|
public function compileUpdateBatch(QueryBuilder $query, array $values, $filed = 'id')
|
||||||
{
|
{
|
||||||
$as = 'as_table';
|
$as = 'as_table';
|
||||||
|
|
||||||
$table = $this->wrapTable($query->from);
|
$table = $this->wrapTable($query->from);
|
||||||
|
|
||||||
if (! is_array(reset($values))) {
|
if (! is_array(reset($values))) {
|
||||||
@ -85,7 +85,7 @@ class PostgresGrammar extends Grammar
|
|||||||
$field = "COALESCE($field, '1970-01-01 08:00:00'::timestamp)";
|
$field = "COALESCE($field, '1970-01-01 08:00:00'::timestamp)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$reference = implode(',', $fields);
|
$reference = implode(',', $fields);
|
||||||
|
|
||||||
// excluded fields are all fields except $unique one that will be updated
|
// excluded fields are all fields except $unique one that will be updated
|
||||||
@ -105,7 +105,7 @@ class PostgresGrammar extends Grammar
|
|||||||
$update = join(', ', array_map(function ($e) {
|
$update = join(', ', array_map(function ($e) {
|
||||||
return "\"$e\" = \"excluded\".\"$e\"";
|
return "\"$e\" = \"excluded\".\"$e\"";
|
||||||
}, $excluded));
|
}, $excluded));
|
||||||
|
|
||||||
return "$insert on conflict ($reference) do update set $update";
|
return "$insert on conflict ($reference) do update set $update";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user