Update Company.php

This commit is contained in:
Anyon 2022-03-25 18:34:14 +08:00
parent 45fc792026
commit 56366a49d5
2 changed files with 7 additions and 4 deletions

View File

@ -88,9 +88,8 @@ class Company extends Controller
try {
$result = ExpressService::instance()->company();
if (empty($result['code'])) $this->error($result['info']);
foreach ($result['data'] as $vo) data_save(BasePostageCompany::class, [
'code_1' => $vo['code_1'], 'code_2' => $vo['code_2'],
'code_3' => $vo['code_3'], 'name' => $vo['title'], 'deleted' => 0,
foreach ($result['data'] as $vo) BasePostageCompany::mUpdate([
'code_1' => $vo['code_1'], 'code_2' => $vo['code_2'], 'code_3' => $vo['code_3'], 'name' => $vo['title'], 'deleted' => 0,
], 'code_1');
$this->success('同步快递公司成功!');
} catch (HttpResponseException $exception) {

View File

@ -1023,7 +1023,11 @@ $(function () {
/*! 注册 data-tips-image 事件行为 */
onEvent('click', '[data-tips-image]', function () {
$.previewImage(this.dataset.tipsImage || this.dataset.lazySrc || this.src, this.dataset.width);
var $imgs, items = [];
($imgs = $(this).parent().find('[data-tips-image]')).map(function () {
items.push({src: this.dataset.tipsImage || this.dataset.lazySrc || this.src});
}) && layui.layer.photos({anim: 5, photos: {start: $imgs.index(this), data: items}});
// $.previewImage(this.dataset.tipsImage || this.dataset.lazySrc || this.src, this.dataset.width);
});
/*! 注册 data-phone-view 事件行为 */