resetModel

This commit is contained in:
邓皓元 2018-12-26 09:43:26 +08:00
parent 80138234e9
commit be29c3f1cd
3 changed files with 9 additions and 6 deletions

View File

@ -68,6 +68,8 @@ class PackageService extends Service
'carrier_operator' => ['required', 'in:0,1,2,3'],
'cost_price' => ['numeric', 'min:0'],
'guide_price' => ['numeric', 'min:0'],
'renewal_cost_price' => ['numeric', 'min:0'],
'renewal_guide_price' => ['numeric', 'min:0'],
'flows' => ['numeric', 'min:0'],
'voices' => ['numeric', 'min:0'],
'messages' => ['numeric', 'min:0'],
@ -100,6 +102,8 @@ class PackageService extends Service
$attributes['cost_price'] = floatval($attributes['cost_price']) * 100;
$attributes['guide_price'] = floatval($attributes['guide_price']) * 100;
$attributes['renewal_cost_price'] = floatval($attributes['renewal_cost_price']) * 100;
$attributes['renewal_guide_price'] = floatval($attributes['renewal_guide_price']) * 100;
if (!$attributes['id']) {
$maxId = Package::withTrashed()->where('type', $attributes['type'])->max('id');

View File

@ -69,12 +69,7 @@ export default {
return;
}
if (!this.params.mobile) {
this.$Message.info('请填写手机号');
return;
}
if (!isPhone(this.params.mobile)) {
if (this.params.mobile && !isPhone(this.params.mobile)) {
this.$Message.info('手机号填写不正确');
return;
}

View File

@ -177,6 +177,8 @@ abstract class Repository implements RepositoryInterface, CacheableInterface, Cr
$results = $this->get($columns);
}
$this->resetModel();
return $this->paginator($results, $total, $limit, $page, [
'path' => Paginator::resolveCurrentPath(),
'pageName' => $pageName,
@ -203,6 +205,8 @@ abstract class Repository implements RepositoryInterface, CacheableInterface, Cr
$this->skip(($page - 1) * $limit)->take($limit + 1);
$this->resetModel();
return $this->simplePaginator($this->get($columns), $limit, $page, [
'path' => Paginator::resolveCurrentPath(),
'pageName' => $pageName,