购物车优化
parent
f58b93b066
commit
b579dc6e77
|
|
@ -86,18 +86,30 @@ class Goods
|
|||
],
|
||||
],
|
||||
[
|
||||
'label' => '商品类型',
|
||||
'label' => '商品分类',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'site_type',
|
||||
'view_data_key' => 'name',
|
||||
'view_data' => lang('common_site_type_list'),
|
||||
'view_key' => 'category_text',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_site_type_list'),
|
||||
'data_key' => 'value',
|
||||
'form_type' => 'module',
|
||||
'template' => 'lib/module/goods_category',
|
||||
'form_name' => 'id',
|
||||
'where_type' => 'in',
|
||||
'where_handle_custom' => 'WhereValueGoodsCategory',
|
||||
'data' => GoodsService::GoodsCategoryAll(),
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '品牌',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'brand_name',
|
||||
'search_config' => [
|
||||
'form_type' => 'module',
|
||||
'template' => 'lib/module/category_brand',
|
||||
'form_name' => 'brand_id',
|
||||
'data' => BrandService::CategoryBrand(),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
'where_type' => 'in',
|
||||
],
|
||||
],
|
||||
[
|
||||
|
|
@ -176,6 +188,21 @@ class Goods
|
|||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '商品类型',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'site_type',
|
||||
'view_data_key' => 'name',
|
||||
'view_data' => lang('common_site_type_list'),
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_site_type_list'),
|
||||
'data_key' => 'value',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '商品型号',
|
||||
'view_type' => 'field',
|
||||
|
|
@ -185,33 +212,6 @@ class Goods
|
|||
'where_type' => 'like',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '商品分类',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'category_text',
|
||||
'search_config' => [
|
||||
'form_type' => 'module',
|
||||
'template' => 'lib/module/goods_category',
|
||||
'form_name' => 'id',
|
||||
'where_type' => 'in',
|
||||
'where_handle_custom' => 'WhereValueGoodsCategory',
|
||||
'data' => GoodsService::GoodsCategoryAll(),
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '品牌',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'brand_name',
|
||||
'search_config' => [
|
||||
'form_type' => 'module',
|
||||
'template' => 'lib/module/category_brand',
|
||||
'form_name' => 'brand_id',
|
||||
'data' => BrandService::CategoryBrand(),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'where_type' => 'in',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '生产地',
|
||||
'view_type' => 'field',
|
||||
|
|
|
|||
|
|
@ -11,15 +11,30 @@
|
|||
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>'attachment'])}}" enctype="multipart/form-data">
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_max_limit_image.name}}<span class="am-form-group-label-tips">{{$data.home_max_limit_image.describe}}</span></label>
|
||||
<input type="number" name="{{$data.home_max_limit_image.only_tag}}" placeholder="{{$data.home_max_limit_image.name}}" data-validation-message="{{$data.home_max_limit_image.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_max_limit_image.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.home_max_limit_image.only_tag}}" placeholder="{{$data.home_max_limit_image.name}}" data-validation-message="{{$data.home_max_limit_image.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_max_limit_image.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">B</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_max_limit_file.name}}<span class="am-form-group-label-tips">{{$data.home_max_limit_file.describe}}</span></label>
|
||||
<input type="number" name="{{$data.home_max_limit_file.only_tag}}" placeholder="{{$data.home_max_limit_file.name}}" data-validation-message="{{$data.home_max_limit_file.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_max_limit_file.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.home_max_limit_file.only_tag}}" placeholder="{{$data.home_max_limit_file.name}}" data-validation-message="{{$data.home_max_limit_file.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_max_limit_file.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">B</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_max_limit_video.name}}<span class="am-form-group-label-tips">{{$data.home_max_limit_video.describe}}</span></label>
|
||||
<input type="number" name="{{$data.home_max_limit_video.only_tag}}" placeholder="{{$data.home_max_limit_video.name}}" data-validation-message="{{$data.home_max_limit_video.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_max_limit_video.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.home_max_limit_video.only_tag}}" placeholder="{{$data.home_max_limit_video.name}}" data-validation-message="{{$data.home_max_limit_video.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_max_limit_video.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">B</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="am-form-group am-form-group-refreshing">
|
||||
|
|
|
|||
|
|
@ -75,9 +75,14 @@
|
|||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_content_max_width.name}}<span class="am-form-group-label-tips">{{$data.home_content_max_width.describe}}</span></label>
|
||||
<input type="number" name="{{$data.home_content_max_width.only_tag}}" placeholder="{{$data.home_content_max_width.name}}" data-validation-message="{{$data.home_content_max_width.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_content_max_width.value}}"{{/if}} required />
|
||||
</div>
|
||||
<label>{{$data.home_content_max_width.name}}<span class="am-form-group-label-tips">{{$data.home_content_max_width.describe}}</span></label>
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.home_content_max_width.only_tag}}" placeholder="{{$data.home_content_max_width.name}}" data-validation-message="{{$data.home_content_max_width.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_content_max_width.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">px</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_static_cache_version.name}}<span class="am-form-group-label-tips">{{$data.home_static_cache_version.describe}}</span></label>
|
||||
<input type="text" name="{{$data.home_static_cache_version.only_tag}}" placeholder="{{$data.home_static_cache_version.describe}}" data-validation-message="{{$data.home_static_cache_version.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.home_static_cache_version.value}}"{{/if}} />
|
||||
|
|
|
|||
|
|
@ -11,11 +11,21 @@
|
|||
<form class="am-form form-validation view-save" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-url" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>'verify'])}}" enctype="multipart/form-data">
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_verify_expire_time.name}}<span class="am-form-group-label-tips">{{$data.common_verify_expire_time.describe}}</span></label>
|
||||
<input type="number" name="{{$data.common_verify_expire_time.only_tag}}" placeholder="{{$data.common_verify_expire_time.name}}" data-validation-message="{{$data.common_verify_expire_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_verify_expire_time.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.common_verify_expire_time.only_tag}}" placeholder="{{$data.common_verify_expire_time.name}}" data-validation-message="{{$data.common_verify_expire_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_verify_expire_time.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">秒</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.common_verify_interval_time.name}}<span class="am-form-group-label-tips">{{$data.common_verify_interval_time.describe}}</span></label>
|
||||
<input type="number" name="{{$data.common_verify_interval_time.only_tag}}" placeholder="{{$data.common_verify_interval_time.name}}" data-validation-message="{{$data.common_verify_interval_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_verify_interval_time.value}}"{{/if}} required />
|
||||
<div class="am-input-group am-input-group-sm">
|
||||
<input type="number" min="0" name="{{$data.common_verify_interval_time.only_tag}}" placeholder="{{$data.common_verify_interval_time.name}}" data-validation-message="{{$data.common_verify_interval_time.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_verify_interval_time.value}}"{{/if}} />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default" type="button">秒</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{$data.home_img_verify_state.name}}<span class="am-form-group-label-tips">{{$data.home_img_verify_state.describe}}</span></label>
|
||||
|
|
|
|||
|
|
@ -131,6 +131,29 @@ class Devtest extends Common
|
|||
echo 'count:'.count($result).', success:'.$success.', fail:'.$fail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品库存初始化
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-07-29
|
||||
* @desc description
|
||||
*/
|
||||
public function GoodsInventoryHandle()
|
||||
{
|
||||
$warehouse_id = 1;
|
||||
$warehouse = Db::name('Warehouse')->where(['id'=>$warehouse_id])->find();
|
||||
if(empty($warehouse))
|
||||
{
|
||||
$data = [
|
||||
'name' => '默认仓库',
|
||||
'is_default' => 1,
|
||||
'add_time' => time(),
|
||||
];
|
||||
$warehouse_id = Db::name('Warehouse')->insertGetId($data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付日志处理
|
||||
* @author Devil
|
||||
|
|
|
|||
|
|
@ -272,6 +272,11 @@ class BuyService
|
|||
$v['is_error'] = 1;
|
||||
$v['error_msg'] = '商品已下架';
|
||||
}
|
||||
if(empty($v['error_msg']) && $v['inventory'] <= 0)
|
||||
{
|
||||
$v['is_error'] = 1;
|
||||
$v['error_msg'] = '商品卖没货了';
|
||||
}
|
||||
$ret = GoodsService::IsGoodsSiteTypeConsistent($v['goods_id'], $v['site_type']);
|
||||
if(empty($v['error_msg']) && $ret['code'] != 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue