冲突文件
This commit is contained in:
commit
bcf8957a67
@ -1,77 +1,77 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* 商城 cache 管理
|
* 商城 cache 管理
|
||||||
* 说明: 主要是一些说明、协议之类的文档管理
|
* 说明: 主要是一些说明、协议之类的文档管理
|
||||||
*
|
*
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
* @date :2023年03月3日
|
* @date :2023年03月3日
|
||||||
*/
|
*/
|
||||||
namespace app\admin\controller\merchant\system;
|
namespace app\admin\controller\merchant\system;
|
||||||
|
|
||||||
use app\admin\BaseController;
|
use app\admin\BaseController;
|
||||||
use think\App;
|
use think\App;
|
||||||
use app\common\model\merchant\system\Cache as CacheModel;
|
use app\common\model\merchant\system\Cache as CacheModel;
|
||||||
|
|
||||||
class Cache extends BaseController
|
class Cache extends BaseController
|
||||||
{
|
{
|
||||||
protected $cache;
|
protected $cache;
|
||||||
|
|
||||||
public function __construct(App $app, CacheModel $cache)
|
public function __construct(App $app, CacheModel $cache)
|
||||||
{
|
{
|
||||||
parent::__construct($app);
|
parent::__construct($app);
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getKeyLst()
|
public function getKeyLst()
|
||||||
{
|
{
|
||||||
$type = $this->request->param('type',0);
|
$type = $this->request->param('type',0);
|
||||||
$data = $this->cache->getAgreeList($type);
|
$data = $this->cache->getAgreeList($type);
|
||||||
|
|
||||||
return to_assign(0,'',$data);
|
return to_assign(0,'',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getAgree($key)
|
public function getAgree($key)
|
||||||
{
|
{
|
||||||
$allow = $this->cache->getAgreeKey();
|
$allow = $this->cache->getAgreeKey();
|
||||||
if (!in_array($key, $allow)) return app('json')->fail('数据不存在');
|
if (!in_array($key, $allow)) return app('json')->fail('数据不存在');
|
||||||
$data = $this->cache->getResult($key);
|
$data = $this->cache->getResult($key);
|
||||||
|
|
||||||
return to_assign(0,'success', $data);
|
return to_assign(0,'success', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function saveAgree($key)
|
public function saveAgree($key)
|
||||||
{
|
{
|
||||||
$allow = $this->cache->getAgreeKey();
|
$allow = $this->cache->getAgreeKey();
|
||||||
if (!in_array($key, $allow)) return app('json')->fail('KEY不存在');
|
if (!in_array($key, $allow)) return app('json')->fail('KEY不存在');
|
||||||
|
|
||||||
$value = get_params('agree');
|
$value = get_params('agree');
|
||||||
$this->cache->saveCache($key, $value);
|
$this->cache->saveCache($key, $value);
|
||||||
|
|
||||||
if ($key == CacheModel::USER_PRIVACY)
|
if ($key == CacheModel::USER_PRIVACY)
|
||||||
$this->cache->setUserAgreement($value);
|
$this->cache->setUserAgreement($value);
|
||||||
if ($key == CacheModel::USER_AGREE)
|
if ($key == CacheModel::USER_AGREE)
|
||||||
$this->cache->setUserRegister($value);
|
$this->cache->setUserRegister($value);
|
||||||
|
|
||||||
return to_assign(0, '保存成功');
|
return to_assign(0, '保存成功');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 清除缓存
|
* TODO 清除缓存
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
*/
|
*/
|
||||||
public function clearCache()
|
public function clearCache()
|
||||||
{
|
{
|
||||||
return to_assign(0,'清除缓存成功');
|
return to_assign(0,'清除缓存成功');
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,30 +1,30 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @date :2023年03月2日
|
* @date :2023年03月2日
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
*
|
*
|
||||||
* @ 商户管理
|
* @ 商户管理
|
||||||
*/
|
*/
|
||||||
namespace app\admin\controller\merchant\system;
|
namespace app\admin\controller\merchant\system;
|
||||||
|
|
||||||
use app\admin\BaseController;
|
use app\admin\BaseController;
|
||||||
use app\common\model\merchant\system\merchant\Merchant as MerchantModel;
|
use app\common\model\merchant\system\merchant\Merchant as MerchantModel;
|
||||||
|
|
||||||
class Merchant extends BaseController{
|
class Merchant extends BaseController{
|
||||||
|
|
||||||
protected $model;
|
protected $model;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
function classify(){
|
function classify(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function system() {
|
public function system() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,118 +1,118 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @date :2023年03月2日
|
* @date :2023年03月2日
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
*
|
*
|
||||||
* @ 商户入驻申请管理
|
* @ 商户入驻申请管理
|
||||||
*/
|
*/
|
||||||
namespace app\admin\controller\merchant\system\merchant;
|
namespace app\admin\controller\merchant\system\merchant;
|
||||||
|
|
||||||
use app\admin\BaseController;
|
use app\admin\BaseController;
|
||||||
use app\validate\merchant\MerchantApplymentsValidate;
|
use app\validate\merchant\MerchantApplymentsValidate;
|
||||||
use app\common\model\merchant\system\merchant\MerchantApplyments as MerchantApplymentsModel;
|
use app\common\model\merchant\system\merchant\MerchantApplyments as MerchantApplymentsModel;
|
||||||
|
|
||||||
class MerchantApplyments extends BaseController
|
class MerchantApplyments extends BaseController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var MerchantModel
|
* @var MerchantModel
|
||||||
*/
|
*/
|
||||||
protected $model;
|
protected $model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merchant constructor.
|
* Merchant constructor.
|
||||||
* @param App $app
|
* @param App $app
|
||||||
* @param MerchantRepository $repository
|
* @param MerchantRepository $repository
|
||||||
*/
|
*/
|
||||||
function __construct(MerchantApplymentsModel $model){
|
function __construct(MerchantApplymentsModel $model){
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 创建申请
|
* TODO 创建申请
|
||||||
* @param MerchantApplymentsValidate $validate
|
* @param MerchantApplymentsValidate $validate
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
public function create(MerchantApplymentsValidate $validate)
|
public function create(MerchantApplymentsValidate $validate)
|
||||||
{
|
{
|
||||||
// if(!systemConfig('open_wx_sub_mch')) return app('json')->fail('未开启子商户入驻');
|
// if(!systemConfig('open_wx_sub_mch')) return app('json')->fail('未开启子商户入驻');
|
||||||
$data = $this->checkParams($validate);
|
$data = $this->checkParams($validate);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 创建申请
|
* TODO 创建申请
|
||||||
* @param MerchantApplymentsValidate $validate
|
* @param MerchantApplymentsValidate $validate
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
public function detail()
|
public function detail()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 编辑提交
|
* TODO 编辑提交
|
||||||
* @param MerchantApplymentsValidate $validate
|
* @param MerchantApplymentsValidate $validate
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
public function update($id,MerchantApplymentsValidate $validate)
|
public function update($id,MerchantApplymentsValidate $validate)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 查询更新状态
|
* TODO 查询更新状态
|
||||||
* @param MerchantApplymentsValidate $validate
|
* @param MerchantApplymentsValidate $validate
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
public function check()
|
public function check()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 上传图片
|
* TODO 上传图片
|
||||||
* @param MerchantApplymentsValidate $validate
|
* @param MerchantApplymentsValidate $validate
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
public function uploadImage($field)
|
public function uploadImage($field)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 检验参数
|
* TODO 检验参数
|
||||||
* @param MerchantApplymentsValidate $validate
|
* @param MerchantApplymentsValidate $validate
|
||||||
* @return \think\response\Json
|
* @return \think\response\Json
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
public function checkParams(MerchantApplymentsValidate $validate)
|
public function checkParams(MerchantApplymentsValidate $validate)
|
||||||
{
|
{
|
||||||
//'organization_cert_info',
|
//'organization_cert_info',
|
||||||
$data = $this->request->params([
|
$data = $this->request->params([
|
||||||
'organization_type','business_license_info','id_doc_type','id_card_info','id_doc_info','need_account_info','account_info','contact_info','sales_scene_info','merchant_shortname','qualifications','business_addition_pics','business_addition_desc'
|
'organization_type','business_license_info','id_doc_type','id_card_info','id_doc_info','need_account_info','account_info','contact_info','sales_scene_info','merchant_shortname','qualifications','business_addition_pics','business_addition_desc'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($data['id_doc_type'] == 1){
|
if($data['id_doc_type'] == 1){
|
||||||
unset($data['id_doc_info']);
|
unset($data['id_doc_info']);
|
||||||
}else{
|
}else{
|
||||||
unset($data['id_card_info']);
|
unset($data['id_card_info']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_array($data['organization_type'],['2401','2500'])){
|
if(in_array($data['organization_type'],['2401','2500'])){
|
||||||
unset($data['business_license_info']);
|
unset($data['business_license_info']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($data['qualifications']) && !$data['qualifications']) unset($data['qualifications']);
|
if(isset($data['qualifications']) && !$data['qualifications']) unset($data['qualifications']);
|
||||||
|
|
||||||
if(isset($data['business_addition_pics']) && !$data['business_addition_pics']) unset($data['business_addition_pics']);
|
if(isset($data['business_addition_pics']) && !$data['business_addition_pics']) unset($data['business_addition_pics']);
|
||||||
if($data['organization_type'] !== 2 && isset($data['id_card_info']['id_card_address'])){
|
if($data['organization_type'] !== 2 && isset($data['id_card_info']['id_card_address'])){
|
||||||
unset($data['id_card_info']['id_card_address']);
|
unset($data['id_card_info']['id_card_address']);
|
||||||
}
|
}
|
||||||
$validate->check($data);
|
$validate->check($data);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,56 +1,56 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @date :2023年03月11日
|
* @date :2023年03月11日
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
*
|
*
|
||||||
* @ 商品分类列表
|
* @ 商品分类列表
|
||||||
*/
|
*/
|
||||||
namespace app\admin\controller\product;
|
namespace app\admin\controller\product;
|
||||||
|
|
||||||
use app\admin\BaseController;
|
use app\admin\BaseController;
|
||||||
use app\admin\model\StoreCategory as StoreCategoryModel;
|
use app\admin\model\StoreCategory as StoreCategoryModel;
|
||||||
use app\common\controller\FormatList;
|
use app\common\controller\FormatList;
|
||||||
|
|
||||||
use app\common\model\merchant\user\UserMerchant;
|
use app\common\model\merchant\user\UserMerchant;
|
||||||
|
|
||||||
class StoreCategory extends BaseController
|
class StoreCategory extends BaseController
|
||||||
{
|
{
|
||||||
protected $category;
|
protected $category;
|
||||||
protected $mer_id = 4;
|
protected $mer_id = 4;
|
||||||
|
|
||||||
public function __construct(StoreCategoryModel $category)
|
public function __construct(StoreCategoryModel $category)
|
||||||
{
|
{
|
||||||
$this->category = $category;
|
$this->category = $category;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getMerId(UserMerchant $user)
|
protected function getMerId(UserMerchant $user)
|
||||||
{
|
{
|
||||||
// $user->isMerUser($uid, $mer_id);
|
// $user->isMerUser($uid, $mer_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 平台商品分类Tree列表
|
* 平台商品分类Tree列表
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getList()
|
public function getList()
|
||||||
{
|
{
|
||||||
$where['mer_id'] = 0;
|
$where['mer_id'] = 0;
|
||||||
$where['is_show'] = 0;
|
$where['is_show'] = 0;
|
||||||
$list = $this->category->getList($where);
|
$list = $this->category->getList($where);
|
||||||
$list = FormatList::DropDownMenu($list);
|
$list = FormatList::DropDownMenu($list);
|
||||||
|
|
||||||
return to_assign(0,'', $list);
|
return to_assign(0,'', $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户商品分类Tree列表
|
* 商户商品分类Tree列表
|
||||||
*/
|
*/
|
||||||
public function getStoreCategoryList(){
|
public function getStoreCategoryList(){
|
||||||
$data = $this->category->getStoreCategoryList($this->mer_id, 1);
|
$data = $this->category->getStoreCategoryList($this->mer_id, 1);
|
||||||
$list = FormatList::FormatCategory($data,'store_category_id', 'pid', 'cate_name','child', 'id', 'title');
|
$list = FormatList::FormatCategory($data,'store_category_id', 'pid', 'cate_name','child', 'id', 'title');
|
||||||
|
|
||||||
return to_assign(0, '', $list);
|
return to_assign(0, '', $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,58 +1,58 @@
|
|||||||
<?php
|
<?php
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
namespace app\common\model\store\product;
|
namespace app\common\model\store\product;
|
||||||
|
|
||||||
use app\common\model\BaseModel;
|
use app\common\model\BaseModel;
|
||||||
|
|
||||||
class ProductLabel extends BaseModel
|
class ProductLabel extends BaseModel
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
* @return string
|
* @return string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 8/17/21
|
* @day 8/17/21
|
||||||
*/
|
*/
|
||||||
public static function tablePk(): string
|
public static function tablePk(): string
|
||||||
{
|
{
|
||||||
return 'product_label_id';
|
return 'product_label_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
* @return string
|
* @return string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 8/17/21
|
* @day 8/17/21
|
||||||
*/
|
*/
|
||||||
public static function tableName(): string
|
public static function tableName(): string
|
||||||
{
|
{
|
||||||
return 'store_product_label';
|
return 'store_product_label';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchMerIdAttr($query, $value)
|
public function searchMerIdAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('mer_id', $value);
|
$query->where('mer_id', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchStatusAttr($query, $value)
|
public function searchStatusAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('status', $value);
|
$query->where('status', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchNameAttr($query, $value)
|
public function searchNameAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->whereLike('name', "%{$value}%");
|
$query->whereLike('name', "%{$value}%");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchIsDelAttr($query, $value)
|
public function searchIsDelAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('is_del', $value);
|
$query->where('is_del', $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,32 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\admin\model\store;
|
namespace app\admin\model\store;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use app\admin\model\StoreCategory;
|
use app\admin\model\StoreCategory;
|
||||||
|
|
||||||
class ProductCate extends Model
|
class ProductCate extends Model
|
||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
protected $table = 'eb_store_product_cate';
|
protected $table = 'eb_store_product_cate';
|
||||||
|
|
||||||
public function category()
|
public function category()
|
||||||
{
|
{
|
||||||
return $this->hasOne(StoreCategory::class,'store_category_id','mer_cate_id')->field('store_category_id, cate_name');
|
return $this->hasOne(StoreCategory::class,'store_category_id','mer_cate_id')->field('store_category_id, cate_name');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchProductIdAttr($query, $value)
|
public function searchProductIdAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('product_id',$value);
|
$query->where('product_id',$value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,129 +1,129 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @date :2023年03月9日
|
* @date :2023年03月9日
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
*
|
*
|
||||||
* @ 商品参数列表与模板添加
|
* @ 商品参数列表与模板添加
|
||||||
*/
|
*/
|
||||||
namespace app\admin\model\store\paramter;
|
namespace app\admin\model\store\paramter;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use app\common\model\merchant\system\merchant\Merchant;
|
use app\common\model\merchant\system\merchant\Merchant;
|
||||||
use app\common\model\merchant\system\Relevance;
|
use app\common\model\merchant\system\Relevance;
|
||||||
// use app\admin\model\store\paramter\Parameter as ParameterModel;
|
// use app\admin\model\store\paramter\Parameter as ParameterModel;
|
||||||
|
|
||||||
class ParameterTemplate extends Model
|
class ParameterTemplate extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
|
|
||||||
|
|
||||||
public static function tablePk(): string
|
public static function tablePk(): string
|
||||||
{
|
{
|
||||||
return 'template_id';
|
return 'template_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tableName(): string
|
public static function tableName(): string
|
||||||
{
|
{
|
||||||
return 'eb_parameter_template';
|
return 'eb_parameter_template';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function merchant()
|
public function merchant()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function parameter()
|
public function parameter()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Parameter::class,'template_id','template_id');
|
return $this->hasMany(Parameter::class,'template_id','template_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cateId()
|
public function cateId()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Relevance::class,'left_id','template_id')->where('type', 'product_params_cate');
|
return $this->hasMany(Relevance::class,'left_id','template_id')->where('type', 'product_params_cate');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchCateIdAttr($query, $value)
|
public function searchCateIdAttr($query, $value)
|
||||||
{
|
{
|
||||||
$id = Relevance::where('right_id',$value)->where('type', 'product_params_cate')->column('left_id');
|
$id = Relevance::where('right_id',$value)->where('type', 'product_params_cate')->column('left_id');
|
||||||
$query->where('template_id','in',$id);
|
$query->where('template_id','in',$id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchTemplateNameAttr($query, $value)
|
public function searchTemplateNameAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->whereLike('template_name',"%{$value}%");
|
$query->whereLike('template_name',"%{$value}%");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchTemplateIdsAttr($query, $value)
|
public function searchTemplateIdsAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->whereIn('template_id',$value);
|
$query->whereIn('template_id',$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchMerIdAttr($query, $value)
|
public function searchMerIdAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('mer_id',$value);
|
$query->where('mer_id',$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchMerNameAttr($query, $value)
|
public function searchMerNameAttr($query, $value)
|
||||||
{
|
{
|
||||||
$value = Merchant::whereLike('mer_name',"%{$value}%")->coupon('mer_id');
|
$value = Merchant::whereLike('mer_name',"%{$value}%")->coupon('mer_id');
|
||||||
$query->whereIn('mer_id',$value);
|
$query->whereIn('mer_id',$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchIsMerAttr($query, $value)
|
public function searchIsMerAttr($query, $value)
|
||||||
{
|
{
|
||||||
if ($value == 1) {
|
if ($value == 1) {
|
||||||
$query->where('mer_id','>',0);
|
$query->where('mer_id','>',0);
|
||||||
} else {
|
} else {
|
||||||
$query->where('mer_id',0);
|
$query->where('mer_id',0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getList($where, $page, $limit)
|
public function getList($where, $page, $limit)
|
||||||
{
|
{
|
||||||
$paramterModel = new Parameter();
|
$paramterModel = new Parameter();
|
||||||
$query = self::getSearch($where)->field('template_id,mer_id,template_name,sort,create_time')
|
$query = self::getSearch($where)->field('template_id,mer_id,template_name,sort,create_time')
|
||||||
->with([
|
->with([
|
||||||
'cateId' => function($query){
|
'cateId' => function($query){
|
||||||
$query->with(['category' =>function($query) {
|
$query->with(['category' =>function($query) {
|
||||||
$query->field('store_category_id,cate_name');
|
$query->field('store_category_id,cate_name');
|
||||||
}]);
|
}]);
|
||||||
},
|
},
|
||||||
'merchant' => function($query) {
|
'merchant' => function($query) {
|
||||||
$query->field('mer_id,mer_name');
|
$query->field('mer_id,mer_name');
|
||||||
}
|
}
|
||||||
// 'parameter' =>function($query){
|
// 'parameter' =>function($query){
|
||||||
// $query->field('parameter_id,template_id,name,value,sort')->order('sort DESC');
|
// $query->field('parameter_id,template_id,name,value,sort')->order('sort DESC');
|
||||||
// }
|
// }
|
||||||
])
|
])
|
||||||
->order('sort DESC,create_time DESC');
|
->order('sort DESC,create_time DESC');
|
||||||
$count = $query->count();
|
$count = $query->count();
|
||||||
$list = $query->page($page, $limit)->select();
|
$list = $query->page($page, $limit)->select();
|
||||||
|
|
||||||
return compact('count', 'list');
|
return compact('count', 'list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 搜索
|
* TODO 搜索
|
||||||
* @param $where
|
* @param $where
|
||||||
*/
|
*/
|
||||||
public static function getSearch(array $where)
|
public static function getSearch(array $where)
|
||||||
{
|
{
|
||||||
foreach ($where as $key => $item) {
|
foreach ($where as $key => $item) {
|
||||||
if ($item !== '') {
|
if ($item !== '') {
|
||||||
$keyArray[] = $key;
|
$keyArray[] = $key;
|
||||||
$whereArr[$key] = $item;
|
$whereArr[$key] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($keyArray)){
|
if(empty($keyArray)){
|
||||||
return new self;
|
return new self;
|
||||||
}else{
|
}else{
|
||||||
return self::withSearch($keyArray, $whereArr);
|
return self::withSearch($keyArray, $whereArr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,157 +1,157 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\common\dao\user;
|
namespace app\common\dao\user;
|
||||||
|
|
||||||
|
|
||||||
// use app\common\model\user\UserLabel;
|
// use app\common\model\user\UserLabel;
|
||||||
use think\db\BaseQuery;
|
use think\db\BaseQuery;
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserMerchant
|
* Class UserMerchant
|
||||||
*/
|
*/
|
||||||
class UserMerchant extends Model
|
class UserMerchant extends Model
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return string|null
|
* @return string|null
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
*/
|
*/
|
||||||
public static function tablePk(): ?string
|
public static function tablePk(): ?string
|
||||||
{
|
{
|
||||||
return 'user_merchant_id';
|
return 'user_merchant_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/10/20
|
* @day 2020/10/20
|
||||||
*/
|
*/
|
||||||
public static function tableName(): string
|
public static function tableName(): string
|
||||||
{
|
{
|
||||||
return 'user_merchant';
|
return 'user_merchant';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->hasOne(User::class, 'uid', 'uid');
|
return $this->hasOne(User::class, 'uid', 'uid');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
* @return array
|
* @return array
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020-05-09
|
* @day 2020-05-09
|
||||||
*/
|
*/
|
||||||
public function getLabelIdAttr($value)
|
public function getLabelIdAttr($value)
|
||||||
{
|
{
|
||||||
return $value ? explode(',', $value) : [];
|
return $value ? explode(',', $value) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
* @return string
|
* @return string
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020-05-09
|
* @day 2020-05-09
|
||||||
*/
|
*/
|
||||||
public function setLabelIdAttr($value)
|
public function setLabelIdAttr($value)
|
||||||
{
|
{
|
||||||
return implode(',', $value);
|
return implode(',', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAuthLabelAttr()
|
public function getAuthLabelAttr()
|
||||||
{
|
{
|
||||||
return app()->make(UserLabel::class)->whereIn('label_id', $this->label_id)->where('mer_id', $this->mer_id)->where('type', 1)->column('label_id');
|
return app()->make(UserLabel::class)->whereIn('label_id', $this->label_id)->where('mer_id', $this->mer_id)->where('type', 1)->column('label_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/10/20
|
* @day 2020/10/20
|
||||||
*/
|
*/
|
||||||
protected function getModel(): string
|
protected function getModel(): string
|
||||||
{
|
{
|
||||||
return UserMerchant::class;
|
return UserMerchant::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $uid
|
* @param $uid
|
||||||
* @param $mer_id
|
* @param $mer_id
|
||||||
* @return bool
|
* @return bool
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/10/20
|
* @day 2020/10/20
|
||||||
*/
|
*/
|
||||||
public function isMerUser($uid, $mer_id)
|
public function isMerUser($uid, $mer_id)
|
||||||
{
|
{
|
||||||
return $this->existsWhere(compact('uid', 'mer_id'));
|
return $this->existsWhere(compact('uid', 'mer_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $uid
|
* @param $uid
|
||||||
* @param $mer_id
|
* @param $mer_id
|
||||||
* @return int
|
* @return int
|
||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/10/20
|
* @day 2020/10/20
|
||||||
*/
|
*/
|
||||||
public function updateLastTime($uid, $mer_id)
|
public function updateLastTime($uid, $mer_id)
|
||||||
{
|
{
|
||||||
return UserMerchant::getDB()->where(compact('uid', 'mer_id'))->update([
|
return UserMerchant::getDB()->where(compact('uid', 'mer_id'))->update([
|
||||||
'last_time' => date('Y-m-d H:i:s')
|
'last_time' => date('Y-m-d H:i:s')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $where
|
* @param array $where
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/10/20
|
* @day 2020/10/20
|
||||||
*/
|
*/
|
||||||
public function search(array $where)
|
public function search(array $where)
|
||||||
{
|
{
|
||||||
return UserMerchant::getDB()->alias('A')->leftJoin('User B', 'A.uid = B.uid')
|
return UserMerchant::getDB()->alias('A')->leftJoin('User B', 'A.uid = B.uid')
|
||||||
->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
|
->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
|
||||||
$query->where('A.mer_id', $where['mer_id']);
|
$query->where('A.mer_id', $where['mer_id']);
|
||||||
})->when(isset($where['nickname']) && $where['nickname'], function (BaseQuery $query) use ($where) {
|
})->when(isset($where['nickname']) && $where['nickname'], function (BaseQuery $query) use ($where) {
|
||||||
return $query->where('B.nickname', 'like', '%' . $where['nickname'] . '%');
|
return $query->where('B.nickname', 'like', '%' . $where['nickname'] . '%');
|
||||||
})->when(isset($where['sex']) && $where['sex'] !== '', function (BaseQuery $query) use ($where) {
|
})->when(isset($where['sex']) && $where['sex'] !== '', function (BaseQuery $query) use ($where) {
|
||||||
return $query->where('B.sex', intval($where['sex']));
|
return $query->where('B.sex', intval($where['sex']));
|
||||||
})->when(isset($where['is_promoter']) && $where['is_promoter'] !== '', function (BaseQuery $query) use ($where) {
|
})->when(isset($where['is_promoter']) && $where['is_promoter'] !== '', function (BaseQuery $query) use ($where) {
|
||||||
return $query->where('B.is_promoter', $where['is_promoter']);
|
return $query->where('B.is_promoter', $where['is_promoter']);
|
||||||
})->when(isset($where['uids']), function (BaseQuery $query) use ($where) {
|
})->when(isset($where['uids']), function (BaseQuery $query) use ($where) {
|
||||||
return $query->whereIn('A.uid', $where['uids']);
|
return $query->whereIn('A.uid', $where['uids']);
|
||||||
})->when(isset($where['user_time_type']) && $where['user_time_type'] !== '' && $where['user_time'] != '', function ($query) use ($where) {
|
})->when(isset($where['user_time_type']) && $where['user_time_type'] !== '' && $where['user_time'] != '', function ($query) use ($where) {
|
||||||
if ($where['user_time_type'] == 'visit') {
|
if ($where['user_time_type'] == 'visit') {
|
||||||
getModelTime($query, $where['user_time'], 'A.last_time');
|
getModelTime($query, $where['user_time'], 'A.last_time');
|
||||||
}
|
}
|
||||||
if ($where['user_time_type'] == 'add_time') {
|
if ($where['user_time_type'] == 'add_time') {
|
||||||
getModelTime($query, $where['user_time'], 'A.create_time');
|
getModelTime($query, $where['user_time'], 'A.create_time');
|
||||||
}
|
}
|
||||||
})->when(isset($where['pay_count']) && $where['pay_count'] !== '', function ($query) use ($where) {
|
})->when(isset($where['pay_count']) && $where['pay_count'] !== '', function ($query) use ($where) {
|
||||||
if ($where['pay_count'] == -1) {
|
if ($where['pay_count'] == -1) {
|
||||||
$query->where('A.pay_num', 0);
|
$query->where('A.pay_num', 0);
|
||||||
} else {
|
} else {
|
||||||
$query->where('A.pay_num', '>', $where['pay_count']);
|
$query->where('A.pay_num', '>', $where['pay_count']);
|
||||||
}
|
}
|
||||||
})->when(isset($where['label_id']) && $where['label_id'] !== '', function (BaseQuery $query) use ($where) {
|
})->when(isset($where['label_id']) && $where['label_id'] !== '', function (BaseQuery $query) use ($where) {
|
||||||
return $query->whereRaw('CONCAT(\',\',A.label_id,\',\') LIKE \'%,' . $where['label_id'] . ',%\'');
|
return $query->whereRaw('CONCAT(\',\',A.label_id,\',\') LIKE \'%,' . $where['label_id'] . ',%\'');
|
||||||
})->when(isset($where['user_type']) && $where['user_type'] !== '', function (BaseQuery $query) use ($where) {
|
})->when(isset($where['user_type']) && $where['user_type'] !== '', function (BaseQuery $query) use ($where) {
|
||||||
return $query->where('B.user_type', $where['user_type']);
|
return $query->where('B.user_type', $where['user_type']);
|
||||||
})->where('A.status', 1);
|
})->where('A.status', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function numUserIds($mer_id, $min, $max = null)
|
public function numUserIds($mer_id, $min, $max = null)
|
||||||
{
|
{
|
||||||
return UserMerchant::getDB()->where('mer_id', $mer_id)->where('pay_num', '>=', $min)->when(!is_null($max), function ($query) use ($max) {
|
return UserMerchant::getDB()->where('mer_id', $mer_id)->where('pay_num', '>=', $min)->when(!is_null($max), function ($query) use ($max) {
|
||||||
$query->where('pay_num', '<=', $max);
|
$query->where('pay_num', '<=', $max);
|
||||||
})->group('uid')->column('uid');
|
})->group('uid')->column('uid');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function priceUserIds($mer_id, $min, $max = null)
|
public function priceUserIds($mer_id, $min, $max = null)
|
||||||
{
|
{
|
||||||
return UserMerchant::getDB()->where('mer_id', $mer_id)->where('pay_price', '>=', $min)->when(!is_null($max), function ($query) use ($max, $min) {
|
return UserMerchant::getDB()->where('mer_id', $mer_id)->where('pay_price', '>=', $min)->when(!is_null($max), function ($query) use ($max, $min) {
|
||||||
$query->where('pay_price', $min == $max ? '<=' : '<', $max);
|
$query->where('pay_price', $min == $max ? '<=' : '<', $max);
|
||||||
})->group('uid')->column('uid');
|
})->group('uid')->column('uid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,304 +1,304 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @date :2023年03月9日
|
* @date :2023年03月9日
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
*
|
*
|
||||||
* @ 商户管理路由
|
* @ 商户管理路由
|
||||||
*/
|
*/
|
||||||
use think\facade\Route;
|
use think\facade\Route;
|
||||||
|
|
||||||
Route::group(function () {
|
Route::group(function () {
|
||||||
|
|
||||||
//参数模板
|
//参数模板
|
||||||
Route::group('/product/params', function () {
|
Route::group('/product/params', function () {
|
||||||
Route::get('index', '/index')->name('merchantStoreParameterTemplateLst')->option([
|
Route::get('index', '/index')->name('merchantStoreParameterTemplateLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
Route::get('detail/:id', '/detail')->name('merchantStoreParameterTemplateDetail')->option([
|
Route::get('detail/:id', '/detail')->name('merchantStoreParameterTemplateDetail')->option([
|
||||||
'_alias' => '详情',
|
'_alias' => '详情',
|
||||||
]);
|
]);
|
||||||
Route::delete('delete/:id', '/delete')->name('merchantStoreParameterTemplateDelete')->option([
|
Route::delete('delete/:id', '/delete')->name('merchantStoreParameterTemplateDelete')->option([
|
||||||
'_alias' => '删除',
|
'_alias' => '删除',
|
||||||
]);
|
]);
|
||||||
Route::get('add', '/add')->name('merchantStoreParameterTemplateCreate')->option([
|
Route::get('add', '/add')->name('merchantStoreParameterTemplateCreate')->option([
|
||||||
'_alias' => '添加',
|
'_alias' => '添加',
|
||||||
]);
|
]);
|
||||||
Route::post('update/:id', '/update')->name('merchantStoreParameterTemplateUpdate')->option([
|
Route::post('update/:id', '/update')->name('merchantStoreParameterTemplateUpdate')->option([
|
||||||
'_alias' => '编辑',
|
'_alias' => '编辑',
|
||||||
]);
|
]);
|
||||||
Route::get('select', '/select')->option([
|
Route::get('select', '/select')->option([
|
||||||
'_alias' => '筛选列表',
|
'_alias' => '筛选列表',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
]);
|
]);
|
||||||
// Route::get('temp/show', '/show')->option([
|
// Route::get('temp/show', '/show')->option([
|
||||||
// '_alias' => '参数',
|
// '_alias' => '参数',
|
||||||
// '_auth' => false,
|
// '_auth' => false,
|
||||||
// ]);
|
// ]);
|
||||||
})->prefix('product.Parameter')->option([
|
})->prefix('product.Parameter')->option([
|
||||||
'_path' => '/product/params',
|
'_path' => '/product/params',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//商品
|
//商品
|
||||||
Route::group('store/product', function () {
|
Route::group('store/product', function () {
|
||||||
Route::get('config', '/config')->option([
|
Route::get('config', '/config')->option([
|
||||||
'_alias' => '配置',
|
'_alias' => '配置',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
]);
|
]);
|
||||||
Route::get('lst_filter', '/getStatusFilter')->name('merchantStoreProductLstFilter')->option([
|
Route::get('lst_filter', '/getStatusFilter')->name('merchantStoreProductLstFilter')->option([
|
||||||
'_alias' => '头部统计',
|
'_alias' => '头部统计',
|
||||||
]);
|
]);
|
||||||
Route::get('lst', '/lst')->name('merchantStoreProductLst')->option([
|
Route::get('lst', '/lst')->name('merchantStoreProductLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
Route::get('list', '/lst')->option([
|
Route::get('list', '/lst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
]);
|
]);
|
||||||
Route::post('create', '/create')->name('merchantStoreProductCreate')->option([
|
Route::post('create', '/create')->name('merchantStoreProductCreate')->option([
|
||||||
'_alias' => '添加',
|
'_alias' => '添加',
|
||||||
]);
|
]);
|
||||||
Route::get('detail/:id', '/detail')->name('merchantStoreProductDetail')->option([
|
Route::get('detail/:id', '/detail')->name('merchantStoreProductDetail')->option([
|
||||||
'_alias' => '详情',
|
'_alias' => '详情',
|
||||||
]);
|
]);
|
||||||
Route::get('temp_key', '/temp_key')->name('merchantStoreProductTempKey')->option([
|
Route::get('temp_key', '/temp_key')->name('merchantStoreProductTempKey')->option([
|
||||||
'_alias' => '上传视频配置',
|
'_alias' => '上传视频配置',
|
||||||
]);
|
]);
|
||||||
Route::post('update/:id', '/update')->name('merchantStoreProductUpdate')->option([
|
Route::post('update/:id', '/update')->name('merchantStoreProductUpdate')->option([
|
||||||
'_alias' => '编辑',
|
'_alias' => '编辑',
|
||||||
]);
|
]);
|
||||||
Route::post('free_trial/:id', '/freeTrial')->name('merchantStoreProductFreeTrial')->option([
|
Route::post('free_trial/:id', '/freeTrial')->name('merchantStoreProductFreeTrial')->option([
|
||||||
'_alias' => '免审编辑',
|
'_alias' => '免审编辑',
|
||||||
]);
|
]);
|
||||||
Route::delete('delete/:id', '/delete')->name('merchantStoreProductDelete')->option([
|
Route::delete('delete/:id', '/delete')->name('merchantStoreProductDelete')->option([
|
||||||
'_alias' => '删除',
|
'_alias' => '删除',
|
||||||
]);
|
]);
|
||||||
Route::delete('destory/:id', '/destory')->name('merchantStoreProductDestory')->option([
|
Route::delete('destory/:id', '/destory')->name('merchantStoreProductDestory')->option([
|
||||||
'_alias' => '加入回收站',
|
'_alias' => '加入回收站',
|
||||||
]);
|
]);
|
||||||
Route::post('restore/:id', '/restore')->name('merchantStoreProductRestore')->option([
|
Route::post('restore/:id', '/restore')->name('merchantStoreProductRestore')->option([
|
||||||
'_alias' => '恢复',
|
'_alias' => '恢复',
|
||||||
]);
|
]);
|
||||||
Route::post('status/:id', '/switchStatus')->name('merchantStoreProductSwitchStatus')->option([
|
Route::post('status/:id', '/switchStatus')->name('merchantStoreProductSwitchStatus')->option([
|
||||||
'_alias' => '上下架',
|
'_alias' => '上下架',
|
||||||
]);
|
]);
|
||||||
Route::post('batch_status', '/batchShow')->name('merchantStoreProductSwitchBatchStatus')->option([
|
Route::post('batch_status', '/batchShow')->name('merchantStoreProductSwitchBatchStatus')->option([
|
||||||
'_alias' => '批量上下架',
|
'_alias' => '批量上下架',
|
||||||
]);
|
]);
|
||||||
Route::post('batch_temp', '/batchTemplate')->name('merchantStoreProductSwitchBatchTemplate')->option([
|
Route::post('batch_temp', '/batchTemplate')->name('merchantStoreProductSwitchBatchTemplate')->option([
|
||||||
'_alias' => '批量设置运费模板',
|
'_alias' => '批量设置运费模板',
|
||||||
]);
|
]);
|
||||||
Route::post('batch_labels', '/batchLabels')->name('merchantStoreProductSwitchBatchLabels')->option([
|
Route::post('batch_labels', '/batchLabels')->name('merchantStoreProductSwitchBatchLabels')->option([
|
||||||
'_alias' => '批量设置标签',
|
'_alias' => '批量设置标签',
|
||||||
]);
|
]);
|
||||||
Route::post('batch_hot', '/batchHot')->name('merchantStoreProductSwitchBatchHot')->option([
|
Route::post('batch_hot', '/batchHot')->name('merchantStoreProductSwitchBatchHot')->option([
|
||||||
'_alias' => '批量设置推荐',
|
'_alias' => '批量设置推荐',
|
||||||
]);
|
]);
|
||||||
Route::post('batch_ext', '/batchExtension')->name('merchantStoreProductSwitchBatchExtension')->option([
|
Route::post('batch_ext', '/batchExtension')->name('merchantStoreProductSwitchBatchExtension')->option([
|
||||||
'_alias' => '批量设置推荐',
|
'_alias' => '批量设置推荐',
|
||||||
]);
|
]);
|
||||||
Route::post('batch_svip', '/batchSvipType')->name('merchantStoreProductSwitchBatchSvipType')->option([
|
Route::post('batch_svip', '/batchSvipType')->name('merchantStoreProductSwitchBatchSvipType')->option([
|
||||||
'_alias' => '批量设置会员价',
|
'_alias' => '批量设置会员价',
|
||||||
]);
|
]);
|
||||||
Route::post('sort/:id', '/updateSort')->name('merchantStoreProductUpdateSort')->option([
|
Route::post('sort/:id', '/updateSort')->name('merchantStoreProductUpdateSort')->option([
|
||||||
'_alias' => '排序',
|
'_alias' => '排序',
|
||||||
]);
|
]);
|
||||||
Route::post('preview', '/preview')->name('merchantStoreProductPreview')->option([
|
Route::post('preview', '/preview')->name('merchantStoreProductPreview')->option([
|
||||||
'_alias' => '预览',
|
'_alias' => '预览',
|
||||||
]);
|
]);
|
||||||
Route::post('labels/:id', '/setLabels')->name('merchantStoreProductLabels')->option([
|
Route::post('labels/:id', '/setLabels')->name('merchantStoreProductLabels')->option([
|
||||||
'_alias' => '标签',
|
'_alias' => '标签',
|
||||||
]);
|
]);
|
||||||
Route::get('attr_value/:id', '/getAttrValue')->name('merchantStoreProductAttrValue')->option([
|
Route::get('attr_value/:id', '/getAttrValue')->name('merchantStoreProductAttrValue')->option([
|
||||||
'_alias' => '获取规格',
|
'_alias' => '获取规格',
|
||||||
]);
|
]);
|
||||||
})->prefix('merchant.store.product.Product')->option([
|
})->prefix('merchant.store.product.Product')->option([
|
||||||
'_path' => '/product/list',
|
'_path' => '/product/list',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
'_append'=> [
|
'_append'=> [
|
||||||
[
|
[
|
||||||
'_name' =>'merchantUploadImage',
|
'_name' =>'merchantUploadImage',
|
||||||
'_path' =>'/product/list',
|
'_path' =>'/product/list',
|
||||||
'_alias' => '上传图片',
|
'_alias' => '上传图片',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'_name' =>'merchantAttachmentLst',
|
'_name' =>'merchantAttachmentLst',
|
||||||
'_path' =>'/product/list',
|
'_path' =>'/product/list',
|
||||||
'_alias' => '图片列表',
|
'_alias' => '图片列表',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
//商品分类
|
//商品分类
|
||||||
Route::group('store/category', function () {
|
Route::group('store/category', function () {
|
||||||
Route::get('create/form', '/createForm')->name('merchantStoreCategoryCreateForm')->option([
|
Route::get('create/form', '/createForm')->name('merchantStoreCategoryCreateForm')->option([
|
||||||
'_alias' => '添加表单',
|
'_alias' => '添加表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'merchantStoreCategoryCreate',
|
'_form' => 'merchantStoreCategoryCreate',
|
||||||
]);
|
]);
|
||||||
Route::get('update/form/:id', '/updateForm')->name('merchantStoreCategoryUpdateForm')->option([
|
Route::get('update/form/:id', '/updateForm')->name('merchantStoreCategoryUpdateForm')->option([
|
||||||
'_alias' => '编辑表单',
|
'_alias' => '编辑表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'merchantStoreCategoryUpdate',
|
'_form' => 'merchantStoreCategoryUpdate',
|
||||||
]);
|
]);
|
||||||
Route::post('update/:id', '/update')->name('merchantStoreCategoryUpdate')->option([
|
Route::post('update/:id', '/update')->name('merchantStoreCategoryUpdate')->option([
|
||||||
'_alias' => '编辑',
|
'_alias' => '编辑',
|
||||||
]);
|
]);
|
||||||
Route::get('lst', '/lst')->name('merchantStoreCategoryLst')->option([
|
Route::get('lst', '/lst')->name('merchantStoreCategoryLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
Route::get('detail/:id', '/detail')->name('merchantStoreCategoryDtailt')->option([
|
Route::get('detail/:id', '/detail')->name('merchantStoreCategoryDtailt')->option([
|
||||||
'_alias' => '详情',
|
'_alias' => '详情',
|
||||||
]);
|
]);
|
||||||
Route::post('create', '/create')->name('merchantStoreCategoryCreate')->option([
|
Route::post('create', '/create')->name('merchantStoreCategoryCreate')->option([
|
||||||
'_alias' => '添加',
|
'_alias' => '添加',
|
||||||
]);
|
]);
|
||||||
Route::delete('delete/:id', '/delete')->name('merchantStoreCategoryDelete')->option([
|
Route::delete('delete/:id', '/delete')->name('merchantStoreCategoryDelete')->option([
|
||||||
'_alias' => '删除',
|
'_alias' => '删除',
|
||||||
]);
|
]);
|
||||||
Route::post('status/:id', '/switchStatus')->name('merchantStoreCategorySwitchStatus')->option([
|
Route::post('status/:id', '/switchStatus')->name('merchantStoreCategorySwitchStatus')->option([
|
||||||
'_alias' => '修改状态',
|
'_alias' => '修改状态',
|
||||||
]);
|
]);
|
||||||
Route::get('list', '/getList')->option([
|
Route::get('list', '/getList')->option([
|
||||||
'_alias' => '筛选',
|
'_alias' => '筛选',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
])->append(['type' => 1]);
|
])->append(['type' => 1]);
|
||||||
Route::get('select', '/getStoreCategoryList')->option([
|
Route::get('select', '/getStoreCategoryList')->option([
|
||||||
'_alias' => '',
|
'_alias' => '',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
]);
|
]);
|
||||||
Route::get('brandlist', '/BrandList')->option([
|
Route::get('brandlist', '/BrandList')->option([
|
||||||
'_alias' => '品牌列表',
|
'_alias' => '品牌列表',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
]);
|
]);
|
||||||
})->prefix('product.StoreCategory')->option([
|
})->prefix('product.StoreCategory')->option([
|
||||||
'_path' => '/product/classify',
|
'_path' => '/product/classify',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
'_append'=> [
|
'_append'=> [
|
||||||
[
|
[
|
||||||
'_name' =>'merchantUploadImage',
|
'_name' =>'merchantUploadImage',
|
||||||
'_path' =>'/product/classify',
|
'_path' =>'/product/classify',
|
||||||
'_alias' => '上传图片',
|
'_alias' => '上传图片',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'_name' =>'merchantAttachmentLst',
|
'_name' =>'merchantAttachmentLst',
|
||||||
'_path' =>'/product/classify',
|
'_path' =>'/product/classify',
|
||||||
'_alias' => '图片列表',
|
'_alias' => '图片列表',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//品牌分类
|
//品牌分类
|
||||||
Route::group('store/brand/category', function () {
|
Route::group('store/brand/category', function () {
|
||||||
Route::get('create/form', '/createForm')->name('systemStoreBrandCategoryCreateForm')->option([
|
Route::get('create/form', '/createForm')->name('systemStoreBrandCategoryCreateForm')->option([
|
||||||
'_alias' => '添加表单',
|
'_alias' => '添加表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'systemStoreBrandCategoryCreate',
|
'_form' => 'systemStoreBrandCategoryCreate',
|
||||||
]);
|
]);
|
||||||
Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandCategoryUpdateForm')->option([
|
Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandCategoryUpdateForm')->option([
|
||||||
'_alias' => '编辑表单',
|
'_alias' => '编辑表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'systemStoreBrandCategoryUpdate',
|
'_form' => 'systemStoreBrandCategoryUpdate',
|
||||||
]);
|
]);
|
||||||
Route::post('update/:id', '/update')->name('systemStoreBrandCategoryUpdate')->option([
|
Route::post('update/:id', '/update')->name('systemStoreBrandCategoryUpdate')->option([
|
||||||
'_alias' => '编辑',
|
'_alias' => '编辑',
|
||||||
]);
|
]);
|
||||||
Route::get('lst', '/lst')->name('systemStoreBrandCategoryLst')->option([
|
Route::get('lst', '/lst')->name('systemStoreBrandCategoryLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
Route::get('detail/:id', '/detail')->name('systemStoreBrandCategoryDtailt')->option([
|
Route::get('detail/:id', '/detail')->name('systemStoreBrandCategoryDtailt')->option([
|
||||||
'_alias' => '详情',
|
'_alias' => '详情',
|
||||||
]);
|
]);
|
||||||
Route::post('create', '/create')->name('systemStoreBrandCategoryCreate')->option([
|
Route::post('create', '/create')->name('systemStoreBrandCategoryCreate')->option([
|
||||||
'_alias' => '添加',
|
'_alias' => '添加',
|
||||||
]);
|
]);
|
||||||
Route::delete('delete/:id', '/delete')->name('systemStoreBrandCategoryDelete')->option([
|
Route::delete('delete/:id', '/delete')->name('systemStoreBrandCategoryDelete')->option([
|
||||||
'_alias' => '删除',
|
'_alias' => '删除',
|
||||||
]);
|
]);
|
||||||
Route::post('status/:id', '/switchStatus')->name('systemStoreBrandCategorySwitchStatus')->option([
|
Route::post('status/:id', '/switchStatus')->name('systemStoreBrandCategorySwitchStatus')->option([
|
||||||
'_alias' => '修改状态',
|
'_alias' => '修改状态',
|
||||||
]);
|
]);
|
||||||
})->prefix('admin.store.StoreBrandCategory')->option([
|
})->prefix('admin.store.StoreBrandCategory')->option([
|
||||||
'_path' => '/product/band/brandClassify',
|
'_path' => '/product/band/brandClassify',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//品牌
|
//品牌
|
||||||
Route::group('store/brand', function () {
|
Route::group('store/brand', function () {
|
||||||
Route::get('create/form', '/createForm')->name('systemStoreBrandCreateForm')->option([
|
Route::get('create/form', '/createForm')->name('systemStoreBrandCreateForm')->option([
|
||||||
'_alias' => '添加表单',
|
'_alias' => '添加表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'systemStoreBrandCreate',
|
'_form' => 'systemStoreBrandCreate',
|
||||||
]);
|
]);
|
||||||
Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandUpdateForm')->option([
|
Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandUpdateForm')->option([
|
||||||
'_alias' => '编辑表单',
|
'_alias' => '编辑表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'systemStoreBrandUpdate',
|
'_form' => 'systemStoreBrandUpdate',
|
||||||
]);
|
]);
|
||||||
Route::get('lst', '/lst')->name('systemStoreBrandLst')->option([
|
Route::get('lst', '/lst')->name('systemStoreBrandLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
Route::post('status/:id', '/switchStatus')->name('systemStoreBrandSwithStatus')->option([
|
Route::post('status/:id', '/switchStatus')->name('systemStoreBrandSwithStatus')->option([
|
||||||
'_alias' => '修改状态',
|
'_alias' => '修改状态',
|
||||||
]);
|
]);
|
||||||
Route::post('create', '/create')->name('systemStoreBrandCreate')->option([
|
Route::post('create', '/create')->name('systemStoreBrandCreate')->option([
|
||||||
'_alias' => '添加',
|
'_alias' => '添加',
|
||||||
]);
|
]);
|
||||||
Route::post('update/:id', '/update')->name('systemStoreBrandUpdate')->option([
|
Route::post('update/:id', '/update')->name('systemStoreBrandUpdate')->option([
|
||||||
'_alias' => '编辑',
|
'_alias' => '编辑',
|
||||||
]);
|
]);
|
||||||
Route::delete('delete/:id', '/delete')->name('systemStoreBrandDelete')->option([
|
Route::delete('delete/:id', '/delete')->name('systemStoreBrandDelete')->option([
|
||||||
'_alias' => '删除',
|
'_alias' => '删除',
|
||||||
]);
|
]);
|
||||||
})->prefix('admin.store.StoreBrand')->option([
|
})->prefix('admin.store.StoreBrand')->option([
|
||||||
'_path' => '/product/band/brandList',
|
'_path' => '/product/band/brandList',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//商品标签
|
//商品标签
|
||||||
Route::group('product/label', function () {
|
Route::group('product/label', function () {
|
||||||
Route::get('lst', '/lst')->name('merchantStoreProductLabelLst')->option([
|
Route::get('lst', '/lst')->name('merchantStoreProductLabelLst')->option([
|
||||||
'_alias' => '列表',
|
'_alias' => '列表',
|
||||||
]);
|
]);
|
||||||
Route::get('create/form', '/createForm')->name('merchantStoreProductLabelCreateForm')->option([
|
Route::get('create/form', '/createForm')->name('merchantStoreProductLabelCreateForm')->option([
|
||||||
'_alias' => '添加表单',
|
'_alias' => '添加表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'merchantStoreProductLabelCreate',
|
'_form' => 'merchantStoreProductLabelCreate',
|
||||||
]);
|
]);
|
||||||
Route::post('create', '/create')->name('merchantStoreProductLabelCreate')->option([
|
Route::post('create', '/create')->name('merchantStoreProductLabelCreate')->option([
|
||||||
'_alias' => '添加',
|
'_alias' => '添加',
|
||||||
]);
|
]);
|
||||||
Route::get('update/:id/form', '/updateForm')->name('merchantStoreProductLabelUpdateForm')->option([
|
Route::get('update/:id/form', '/updateForm')->name('merchantStoreProductLabelUpdateForm')->option([
|
||||||
'_alias' => '编辑表单',
|
'_alias' => '编辑表单',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
'_form' => 'merchantStoreProductLabelUpdate',
|
'_form' => 'merchantStoreProductLabelUpdate',
|
||||||
]);
|
]);
|
||||||
Route::post('update/:id', '/update')->name('merchantStoreProductLabelUpdate')->option([
|
Route::post('update/:id', '/update')->name('merchantStoreProductLabelUpdate')->option([
|
||||||
'_alias' => '编辑',
|
'_alias' => '编辑',
|
||||||
]);
|
]);
|
||||||
Route::get('detail/:id', '/detail')->name('merchantStoreProductLabelDetail')->option([
|
Route::get('detail/:id', '/detail')->name('merchantStoreProductLabelDetail')->option([
|
||||||
'_alias' => '详情',
|
'_alias' => '详情',
|
||||||
]);
|
]);
|
||||||
Route::delete('delete/:id', '/delete')->name('merchantStoreProductLabelDelete')->option([
|
Route::delete('delete/:id', '/delete')->name('merchantStoreProductLabelDelete')->option([
|
||||||
'_alias' => '删除',
|
'_alias' => '删除',
|
||||||
]);
|
]);
|
||||||
Route::post('status/:id', '/switchWithStatus')->name('merchantStoreProductLabelStatus')->option([
|
Route::post('status/:id', '/switchWithStatus')->name('merchantStoreProductLabelStatus')->option([
|
||||||
'_alias' => '修改状态',
|
'_alias' => '修改状态',
|
||||||
]);
|
]);
|
||||||
Route::get('option', '/getOptions')->option([
|
Route::get('option', '/getOptions')->option([
|
||||||
'_alias' => '筛选',
|
'_alias' => '筛选',
|
||||||
'_auth' => false,
|
'_auth' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
})->prefix('merchant.store.product.ProductLabel')->option([
|
})->prefix('merchant.store.product.ProductLabel')->option([
|
||||||
'_path' => '/product/label',
|
'_path' => '/product/label',
|
||||||
'_auth' => true,
|
'_auth' => true,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
@ -1,454 +1,453 @@
|
|||||||
{extend name="common/base"/}
|
{extend name="common/base"/}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<style>
|
<style>
|
||||||
.layui-btn-group{
|
.layui-btn-group{
|
||||||
display:flex;
|
display:flex;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
|
|
||||||
|
|
||||||
<!-- 时间选择 -->
|
<!-- 时间选择 -->
|
||||||
<div class="layui-form">
|
<div class="layui-form">
|
||||||
|
|
||||||
<form id="filterform" class="layui-form" action="">
|
<form id="filterform" class="layui-form" action="">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<label class="layui-form-label">选择时间</label>
|
<label class="layui-form-label">选择时间</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-btn-group">
|
<div class="layui-btn-group">
|
||||||
<input id="chonse_start_date" type="hidden" name="start_date" value="" readonly placeholder="选择时间">
|
<input id="chonse_start_date" type="hidden" name="start_date" value="" readonly placeholder="选择时间">
|
||||||
<input id="chonse_end_date" type="hidden" name="end_date" value="" readonly placeholder="选择时间">
|
<input id="chonse_end_date" type="hidden" name="end_date" value="" readonly placeholder="选择时间">
|
||||||
<button id="both" name="both" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal">全部</button>
|
<button id="both" name="both" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||||
<button name="today" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
<button name="today" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
||||||
<button name="yeserday" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
<button name="yeserday" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
||||||
<button name="week" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
<button name="week" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
||||||
<button name="30day" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
<button name="30day" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
||||||
<button name="month" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
<button name="month" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
||||||
<button name="year" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
<button name="year" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<!-- <label class="layui-form-label">日期范围</label> -->
|
<!-- <label class="layui-form-label">日期范围</label> -->
|
||||||
<div class="layui-inline" id="range_date">
|
<div class="layui-inline" id="range_date">
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" autocomplete="off" name="start_date" id="start-date" class="layui-input" placeholder="开始日期">
|
<input type="text" autocomplete="off" name="start_date" id="start-date" class="layui-input" placeholder="开始日期">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid">-</div>
|
<div class="layui-form-mid">-</div>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" autocomplete="off" name="end_date" id="end-date" class="layui-input" placeholder="结束日期">
|
<input type="text" autocomplete="off" name="end_date" id="end-date" class="layui-input" placeholder="结束日期">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-input-inline" style="width:45%;">
|
<div class="layui-input-inline" style="width:45%;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商户审核</label>
|
<label class="layui-form-label">商户审核</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-btn-group">
|
<div class="layui-btn-group">
|
||||||
<input type="hidden" id="status" name="status" value="" readonly placeholder="核审状态值">
|
<input type="hidden" id="status" name="status" value="" readonly placeholder="核审状态值">
|
||||||
<button name="both" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
<button name="both" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||||
<button name="wait" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
<button name="wait" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
||||||
<button name="success" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核通过</button>
|
<button name="success" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核通过</button>
|
||||||
<button name="failed" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核未通过</button>
|
<button name="failed" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核未通过</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;float:none;">
|
<div class="layui-input-inline" style="width:45%;float:none;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商户分类</label>
|
<label class="layui-form-label">商户分类</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="category_id" lay-filter="seleform">
|
<select name="category_id" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
{volist name="category" key="k" id="vo"}
|
{volist name="category" key="k" id="vo"}
|
||||||
<option value="{$vo.merchant_category_id}">{$vo.category_name}</option>
|
<option value="{$vo.merchant_category_id}">{$vo.category_name}</option>
|
||||||
{/volist}
|
{/volist}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;">
|
<div class="layui-input-inline" style="width:45%;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">店铺类型</label>
|
<label class="layui-form-label">店铺类型</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="type_id" lay-filter="seleform">
|
<select name="type_id" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
{volist name="type" key="k" id="vo"}
|
{volist name="type" key="k" id="vo"}
|
||||||
<option value="{$vo.mer_type_id}">{$vo.type_name}</option>
|
<option value="{$vo.mer_type_id}">{$vo.type_name}</option>
|
||||||
{/volist}
|
{/volist}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;">
|
<div class="layui-input-inline" style="width:45%;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">关键字</label>
|
<label class="layui-form-label">关键字</label>
|
||||||
<div class="layui-input-block" style="display:flex">
|
<div class="layui-input-block" style="display:flex">
|
||||||
<input style="width:70%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
<input style="width:70%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
||||||
class="layui-input" autocomplete="off" />
|
class="layui-input" autocomplete="off" />
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit=""
|
<button class="layui-btn layui-btn-normal" lay-submit=""
|
||||||
lay-filter="searchform">提交搜索</button>
|
lay-filter="searchform">提交搜索</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<table class="layui-hide" id="intention_list" lay-filter="intention_list">
|
<table class="layui-hide" id="intention_list" lay-filter="intention_list">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- test end -->
|
<!-- test end -->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<script type="text/html" id="toolbarDemo"></script>
|
<script type="text/html" id="toolbarDemo"></script>
|
||||||
<script type="text/html" id="barDemo">
|
<script type="text/html" id="barDemo">
|
||||||
<div class="layui-btn-group">
|
<div class="layui-btn-group">
|
||||||
{{# if(d.status == 0 ){ }}
|
{{# if(d.status == 0 ){ }}
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="status">审核</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="status">审核</a>
|
||||||
{{# } }}
|
{{# } }}
|
||||||
|
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="mark">备注</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="mark">备注</a>
|
||||||
<a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
|
<a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
const moduleInit = ['tool'];
|
const moduleInit = ['tool'];
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#intention_list',
|
elem: '#intention_list',
|
||||||
title: '商户入驻申请列表',
|
title: '商户入驻申请列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: '/admin/merchant/intention/lst',
|
url: '/admin/merchant/intention/lst',
|
||||||
parseData: function(res){ //res 即为原始返回的数据
|
parseData: function(res){ //res 即为原始返回的数据
|
||||||
return {
|
return {
|
||||||
"code": res.code, //解析接口状态
|
"code": res.code, //解析接口状态
|
||||||
"msg": res.msg, //解析提示文本
|
"msg": res.msg, //解析提示文本
|
||||||
"count": res.data.count, //解析数据长度
|
"count": res.data.count, //解析数据长度
|
||||||
"data": res.data.list //解析数据列表
|
"data": res.data.list //解析数据列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
page: true,
|
page: true,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
cellMinWidth: 300,
|
cellMinWidth: 300,
|
||||||
cols: [
|
cols: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
fixed: 'ID',
|
fixed: 'ID',
|
||||||
field: 'mer_intention_id',
|
field: 'mer_intention_id',
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 80
|
width: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'mer_name',
|
field: 'mer_name',
|
||||||
title: '商户名称',
|
title: '商户名称',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 200,
|
width: 200,
|
||||||
}, {
|
}, {
|
||||||
field: 'category_name',
|
field: 'category_name',
|
||||||
title: '商户分类',
|
title: '商户分类',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
templet: '<div>{{d.merchantCategory.category_name}}</div>'
|
templet: '<div>{{d.merchantCategory.category_name}}</div>'
|
||||||
},{
|
},{
|
||||||
field: 'type_name',
|
field: 'type_name',
|
||||||
title: '店铺类型',
|
title: '店铺类型',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
templet: '<div>{{d.merchantType.type_name}}</div>'
|
templet: '<div>{{d.merchantType.type_name}}</div>'
|
||||||
}, {
|
}, {
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '商户姓名',
|
title: '商户姓名',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
}, {
|
}, {
|
||||||
field: 'phone',
|
field: 'phone',
|
||||||
title: '联系方式',
|
title: '联系方式',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 100,
|
width: 100,
|
||||||
}, {
|
}, {
|
||||||
field: 'create_time',
|
field: 'create_time',
|
||||||
title: '申请时间',
|
title: '申请时间',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
},{
|
},{
|
||||||
field: 'images',
|
field: 'images',
|
||||||
title: '资质图片',
|
title: '资质图片',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
},{
|
},{
|
||||||
field: 'status',
|
field: 'status',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 150,
|
width: 150,
|
||||||
templet: function(d){
|
templet: function(d){
|
||||||
if (d.status==0){
|
if (d.status==0){
|
||||||
return '<span style="color:yellow">待审核</span>'
|
return '<span style="color:yellow">待审核</span>'
|
||||||
}else if(d.status==1){
|
}else if(d.status==1){
|
||||||
return '<span style="color:green">已审核</span>'
|
return '<span style="color:green">已审核</span>'
|
||||||
}else if(d.status==2){
|
}else if(d.status==2){
|
||||||
return '<span style="color:red">审核未通过</span>'
|
return '<span style="color:red">审核未通过</span>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
field: 'mark',
|
field: 'mark',
|
||||||
title: '备注',
|
title: '备注',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
field: 'right',
|
field: 'right',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
toolbar: '#barDemo',
|
toolbar: '#barDemo',
|
||||||
width: 190,
|
width: 190,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//监听表头工具栏事件
|
//监听表头工具栏事件
|
||||||
// table.on('toolbar(store_product)', function (obj) {
|
// table.on('toolbar(store_product)', function (obj) {
|
||||||
// if (obj.event === 'add') {
|
// if (obj.event === 'add') {
|
||||||
// tool.side("/admin/merchant/type/form");
|
// tool.side("/admin/merchant/type/form");
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
//监听表格行工具事件
|
//监听表格行工具事件
|
||||||
table.on('tool(intention_list)', function (obj) {
|
table.on('tool(intention_list)', function (obj) {
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
if (obj.event === 'mark') { //备注
|
if (obj.event === 'mark') { //备注
|
||||||
tool.side('/admin/merchant/intention/markform?id=' + obj.data.mer_intention_id);
|
tool.side('/admin/merchant/intention/markform?id=' + obj.data.mer_intention_id);
|
||||||
} else if (obj.event === 'status') { //审核
|
} else if (obj.event === 'status') { //审核
|
||||||
tool.side('/admin/merchant/intention/statusform?id=' + obj.data.mer_intention_id);
|
tool.side('/admin/merchant/intention/statusform?id=' + obj.data.mer_intention_id);
|
||||||
} else if (obj.event === 'del') { //删除
|
} else if (obj.event === 'del') { //删除
|
||||||
layer.confirm('确定要删除该记录吗?', {
|
layer.confirm('确定要删除该记录吗?', {
|
||||||
icon: 3,
|
icon: 3,
|
||||||
title: '提示'
|
title: '提示'
|
||||||
}, function(index) {
|
}, function(index) {
|
||||||
let callback = function (e) {
|
let callback = function (e) {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
obj.del();
|
obj.del();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tool.delete("/admin/merchant/intention/del", { id: data.mer_intention_id }, callback);
|
tool.delete("/admin/merchant/intention/del", { id: data.mer_intention_id }, callback);
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 日期范围
|
// 日期范围
|
||||||
layui.use(['laydate','table','element', 'jquery'], function () {
|
layui.use(['laydate','table','element', 'jquery'], function () {
|
||||||
var laydate = layui.laydate;
|
var laydate = layui.laydate;
|
||||||
|
//日期范围
|
||||||
//日期范围
|
laydate.render({
|
||||||
laydate.render({
|
elem: '#range_date'
|
||||||
elem: '#range_date'
|
//设置开始日期、日期日期的 input 选择器
|
||||||
//设置开始日期、日期日期的 input 选择器
|
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
, range: ['#start-date', '#end-date']
|
||||||
, range: ['#start-date', '#end-date']
|
,done: function(value, date, endDate){
|
||||||
,done: function(value, date, endDate){
|
switchDateForm(true);
|
||||||
switchDateForm(true);
|
|
||||||
|
$('#both').removeClass('layui-btn-primary')
|
||||||
$('#both').removeClass('layui-btn-primary')
|
$('#both').siblings().addClass('layui-btn-primary')
|
||||||
$('#both').siblings().addClass('layui-btn-primary')
|
active['reload'] ? active['reload'].call(this) : '';
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
|
//
|
||||||
//
|
var $ = layui.$, active = {
|
||||||
var $ = layui.$, active = {
|
reload: function(){
|
||||||
reload: function(){
|
let dataRload = getformdata();
|
||||||
let dataRload = getformdata();
|
//console.log(dataRload)
|
||||||
//console.log(dataRload)
|
//执行重载
|
||||||
//执行重载
|
table.reload('intention_list', {
|
||||||
table.reload('intention_list', {
|
page: {
|
||||||
page: {
|
curr: 1 //重新从第 1 页开始
|
||||||
curr: 1 //重新从第 1 页开始
|
}
|
||||||
}
|
,where: {
|
||||||
,where: {
|
...dataRload
|
||||||
...dataRload
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
//监听button提交
|
||||||
//监听button提交
|
form.on('submit(searchform)', function(data) {
|
||||||
form.on('submit(searchform)', function(data) {
|
layui.pageTable.reload({
|
||||||
layui.pageTable.reload({
|
where: {
|
||||||
where: {
|
...data.field
|
||||||
...data.field
|
},
|
||||||
},
|
page: {
|
||||||
page: {
|
curr: 1
|
||||||
curr: 1
|
}
|
||||||
}
|
});
|
||||||
});
|
return false;
|
||||||
return false;
|
});
|
||||||
});
|
|
||||||
|
//选择时间
|
||||||
//选择时间
|
form.on('submit(chonse_date)', function(data){
|
||||||
form.on('submit(chonse_date)', function(data){
|
|
||||||
|
let start_date = '';
|
||||||
let start_date = '';
|
let end_date = getDaysAgo();
|
||||||
let end_date = getDaysAgo();
|
|
||||||
|
let name = data.elem.name;
|
||||||
let name = data.elem.name;
|
if (name =='today') {
|
||||||
if (name =='today') {
|
start_date=end_date;
|
||||||
start_date=end_date;
|
end_date = getDaysAgo(-1);
|
||||||
end_date = getDaysAgo(-1);
|
}else if(name == 'yeserday'){
|
||||||
}else if(name == 'yeserday'){
|
start_date = getDaysAgo(1);
|
||||||
start_date = getDaysAgo(1);
|
}else if(name == 'week'){
|
||||||
}else if(name == 'week'){
|
start_date = getDaysAgo(7);
|
||||||
start_date = getDaysAgo(7);
|
}else if(name == '30day'){
|
||||||
}else if(name == '30day'){
|
start_date = getDaysAgo(30);
|
||||||
start_date = getDaysAgo(30);
|
}else if(name == 'month'){
|
||||||
}else if(name == 'month'){
|
let days = (new Date).getDate()-1
|
||||||
let days = (new Date).getDate()-1
|
start_date = getDaysAgo(days);
|
||||||
start_date = getDaysAgo(days);
|
}else if(name == 'year'){
|
||||||
}else if(name == 'year'){
|
var year = (new Date()).getFullYear();//获取当前年份
|
||||||
var year = (new Date()).getFullYear();//获取当前年份
|
start_date = year+'-01-01'
|
||||||
start_date = year+'-01-01'
|
}else{
|
||||||
}else{
|
end_date = '';
|
||||||
end_date = '';
|
}
|
||||||
}
|
|
||||||
|
switchClass(this)
|
||||||
switchClass(this)
|
|
||||||
|
switchDateForm(false);
|
||||||
switchDateForm(false);
|
$('#chonse_start_date').val(start_date);
|
||||||
$('#chonse_start_date').val(start_date);
|
$('#chonse_end_date').val(end_date);
|
||||||
$('#chonse_end_date').val(end_date);
|
|
||||||
|
active['reload'] ? active['reload'].call(this) : '';
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
|
||||||
|
return false;
|
||||||
return false;
|
})
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
// 商户审核
|
||||||
// 商户审核
|
form.on('submit(statusform)', function(data) {
|
||||||
form.on('submit(statusform)', function(data) {
|
let name = data.elem.name
|
||||||
let name = data.elem.name
|
let status = 0;
|
||||||
let status = 0;
|
|
||||||
|
if (name=='wait') {
|
||||||
if (name=='wait') {
|
status = 0;
|
||||||
status = 0;
|
}else if(name=='success'){
|
||||||
}else if(name=='success'){
|
status = 1;
|
||||||
status = 1;
|
}else if(name=='failed'){
|
||||||
}else if(name=='failed'){
|
status = 2;
|
||||||
status = 2;
|
}
|
||||||
}
|
if (name=='both'){
|
||||||
if (name=='both'){
|
$('#status').attr('disabled', true);
|
||||||
$('#status').attr('disabled', true);
|
}else{
|
||||||
}else{
|
$('#status').attr('disabled', false);
|
||||||
$('#status').attr('disabled', false);
|
}
|
||||||
}
|
switchClass(this)
|
||||||
switchClass(this)
|
$('#status').val(status);
|
||||||
$('#status').val(status);
|
active['reload'] ? active['reload'].call(this) : '';
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
return false;
|
||||||
return false;
|
});
|
||||||
});
|
|
||||||
|
//监听select提交
|
||||||
//监听select提交
|
form.on('select(seleform)', function(data) {
|
||||||
form.on('select(seleform)', function(data) {
|
active['reload'] ? active['reload'].call(this) : '';
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
|
||||||
|
return false;
|
||||||
return false;
|
});
|
||||||
});
|
|
||||||
|
});
|
||||||
});
|
|
||||||
|
// 切换button选中样式
|
||||||
// 切换button选中样式
|
function switchClass(e)
|
||||||
function switchClass(e)
|
{
|
||||||
{
|
$(e).removeClass('layui-btn-primary')
|
||||||
$(e).removeClass('layui-btn-primary')
|
$(e).siblings().addClass('layui-btn-primary')
|
||||||
$(e).siblings().addClass('layui-btn-primary')
|
}
|
||||||
}
|
|
||||||
|
// 两个时间表单是互斥的,只能提交一个
|
||||||
// 两个时间表单是互斥的,只能提交一个
|
function switchDateForm(chonse=false)
|
||||||
function switchDateForm(chonse=false)
|
{
|
||||||
{
|
let range = chonse?false:true;
|
||||||
let range = chonse?false:true;
|
$('#start-date').attr("disabled",range);
|
||||||
$('#start-date').attr("disabled",range);
|
$('#end-date').attr("disabled",range);
|
||||||
$('#end-date').attr("disabled",range);
|
|
||||||
|
$('#chonse_start_date').attr("disabled",chonse);
|
||||||
$('#chonse_start_date').attr("disabled",chonse);
|
$('#chonse_end_date').attr("disabled",chonse);
|
||||||
$('#chonse_end_date').attr("disabled",chonse);
|
if (chonse) {
|
||||||
if (chonse) {
|
$('#chonse_start_date').val("");
|
||||||
$('#chonse_start_date').val("");
|
$('#chonse_end_date').val("");
|
||||||
$('#chonse_end_date').val("");
|
}else{
|
||||||
}else{
|
$('#start-date').val("");
|
||||||
$('#start-date').val("");
|
$('#end-date').val("");
|
||||||
$('#end-date').val("");
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
//获取n天以前日期
|
||||||
//获取n天以前日期
|
function getDaysAgo(n=0) {
|
||||||
function getDaysAgo(n=0) {
|
let myDate = new Date();
|
||||||
let myDate = new Date();
|
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * n); //最后一个数字30可改,n天前的意思
|
||||||
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * n); //最后一个数字30可改,n天前的意思
|
let lastY = lw.getFullYear();
|
||||||
let lastY = lw.getFullYear();
|
let lastM = lw.getMonth() + 1;
|
||||||
let lastM = lw.getMonth() + 1;
|
let lastD = lw.getDate();
|
||||||
let lastD = lw.getDate();
|
lastM = lastM < 10 ? "0" + lastM : lastM;
|
||||||
lastM = lastM < 10 ? "0" + lastM : lastM;
|
lastD = lastD < 10 ? "0" + lastD : lastD;
|
||||||
lastD = lastD < 10 ? "0" + lastD : lastD;
|
let startData = lastY+"-"+lastM+"-" +lastD; //n天之前日期
|
||||||
let startData = lastY+"-"+lastM+"-" +lastD; //n天之前日期
|
|
||||||
|
return startData;
|
||||||
return startData;
|
}
|
||||||
}
|
|
||||||
|
// 获取表单所有参数
|
||||||
// 获取表单所有参数
|
function getformdata() {
|
||||||
function getformdata() {
|
var form = $('#filterform').serializeArray();
|
||||||
var form = $('#filterform').serializeArray();
|
var data = new Array();
|
||||||
var data = new Array();
|
for(let i=0;i<form.length; i++){
|
||||||
for(let i=0;i<form.length; i++){
|
data[form[i].name] = form[i].value;
|
||||||
data[form[i].name] = form[i].value;
|
}
|
||||||
}
|
|
||||||
|
return data;
|
||||||
return data;
|
}
|
||||||
}
|
}
|
||||||
}
|
</script>
|
||||||
</script>
|
{/block}
|
||||||
{/block}
|
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -1,56 +1,57 @@
|
|||||||
{extend name="common/base"/}
|
{extend name="common/base"/}
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form p-4">
|
<form class="layui-form p-4">
|
||||||
<h3 class="pb-3">备注</h3>
|
<h3 class="pb-3">备注</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<textarea class="layui-textarea" name="mark"></textarea>
|
<textarea class="layui-textarea" name="mark"></textarea>
|
||||||
<input type="hidden" name="id" value="{$id}">
|
<input type="hidden" name="id" value="{$id}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="pt-3">
|
<div class="pt-3">
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type="button">立即提交</button>
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type="button">立即提交</button>
|
||||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
|
|
||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script src="/static/assets/js/xm-select.js"></script>
|
<script src="/static/assets/js/xm-select.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||||
|
|
||||||
|
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||||
|
|
||||||
//监听提交
|
//监听提交
|
||||||
form.on('submit(webform)', function (data) {
|
form.on('submit(webform)', function (data) {
|
||||||
if (data.field == '') {
|
console.log(data);
|
||||||
layer.msg('请先完善商品详情');
|
if (data.field == '') {
|
||||||
return false;
|
layer.msg('请先完善商品详情');
|
||||||
}
|
return false;
|
||||||
let callback = function (e) {
|
}
|
||||||
layer.msg(e.msg);
|
let callback = function (e) {
|
||||||
if (e.code == 0) {
|
layer.msg(e.msg);
|
||||||
tool.tabRefresh(71);
|
if (e.code == 0) {
|
||||||
tool.sideClose(1000);
|
tool.tabRefresh(71);
|
||||||
}
|
tool.sideClose(1000);
|
||||||
}
|
}
|
||||||
tool.post('/admin/merchant/intention/mark', data.field, callback);
|
}
|
||||||
return false;
|
tool.post('/admin/merchant/intention/mark', data.field, callback);
|
||||||
});
|
return false;
|
||||||
|
});
|
||||||
}
|
|
||||||
</script>
|
}
|
||||||
{/block}
|
</script>
|
||||||
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -1,66 +1,66 @@
|
|||||||
{extend name="common/base" /}
|
{extend name="common/base" /}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form p-4">
|
<form class="layui-form p-4">
|
||||||
<h3 class="pb-3">审核状态</h3>
|
<h3 class="pb-3">审核状态</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray-2">审核状态<font>*</font>
|
<td class="layui-td-gray-2">审核状态<font>*</font>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select name="status" lay-verify="required" lay-reqText="审核状态">
|
<select name="status" lay-verify="required" lay-reqText="审核状态">
|
||||||
<option selected="selected" value="1">同意</option>
|
<option selected="selected" value="1">同意</option>
|
||||||
<option value="2">不同意</option>
|
<option value="2">不同意</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray-2">创建商户<font>*</font>
|
<td class="layui-td-gray-2">创建商户<font>*</font>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" checked="checked" name="create_mer" value="1" title="是">
|
<input type="radio" checked="checked" name="create_mer" value="1" title="是">
|
||||||
<input type="radio" name="create_mer" value="0" title="不是">
|
<input type="radio" name="create_mer" value="0" title="不是">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div style="padding: 10px 0">
|
<div style="padding: 10px 0">
|
||||||
<input type="hidden" name="id" value="{$id}">
|
<input type="hidden" name="id" value="{$id}">
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
|
|
||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
const moduleInit = ['tool'];
|
const moduleInit = ['tool'];
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var form = layui.form,tool=layui.tool;
|
var form = layui.form,tool=layui.tool;
|
||||||
//监听提交
|
//监听提交
|
||||||
form.on('submit(webform)', function (data) {
|
form.on('submit(webform)', function (data) {
|
||||||
console.log(data.field)
|
console.log(data.field)
|
||||||
if (!data.field.status || data.field.id == '' || data.field.create_mer == '') {
|
if (!data.field.status || data.field.id == '' || data.field.create_mer == '') {
|
||||||
layer.msg('请选择审核表单');
|
layer.msg('请选择审核表单');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let callback = function (e) {
|
let callback = function (e) {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
parent.location.reload();
|
parent.location.reload();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tool.post('/admin/merchant/intention/status', data.field, callback);
|
tool.post('/admin/merchant/intention/status', data.field, callback);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -1,116 +1,116 @@
|
|||||||
{extend name="common/base"/}
|
{extend name="common/base"/}
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.editormd-code-toolbar select {
|
.editormd-code-toolbar select {
|
||||||
display: inline-block
|
display: inline-block
|
||||||
}
|
}
|
||||||
|
|
||||||
.editormd li {
|
.editormd li {
|
||||||
list-style: inherit;
|
list-style: inherit;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<form class="layui-form p-4">
|
<form class="layui-form p-4">
|
||||||
<h3 class="pb-3">保证金扣费</h3>
|
<h3 class="pb-3">保证金扣费</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="layui-td-gray">商户名称<font>*</font></td>
|
<td colspan="2" class="layui-td-gray">商户名称<font>*</font></td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<input type="text" name="mer_name" lay-verify="required"
|
<input type="text" name="mer_name" lay-verify="required"
|
||||||
lay-reqText="商户名称" disabled autocomplete="off" placeholder="商户名称" class="layui-input" value="{$data.mer_name}">
|
lay-reqText="商户名称" disabled autocomplete="off" placeholder="商户名称" class="layui-input" value="{$data.mer_name}">
|
||||||
<!-- <input type="text" name="type" lay-verify="required"
|
<!-- <input type="text" name="type" lay-verify="required"
|
||||||
lay-reqText="明细类型" hidden= autocomplete="off" placeholder="明细类型" class="layui-input" value="{$data.type}"> -->
|
lay-reqText="明细类型" hidden= autocomplete="off" placeholder="明细类型" class="layui-input" value="{$data.type}"> -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="layui-td-gray">商户ID</td>
|
<td colspan="2" class="layui-td-gray">商户ID</td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<input type="number" name="mer_id" lay-verify="required" lay-reqText="0" autocomplete="off" disabled placeholder="0" class="layui-input" value="{$data.mer_id}">
|
<input type="number" name="mer_id" lay-verify="required" lay-reqText="0" autocomplete="off" disabled placeholder="0" class="layui-input" value="{$data.mer_id}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="layui-td-gray">商户剩余保证金</td>
|
<td colspan="2" class="layui-td-gray">商户剩余保证金</td>
|
||||||
<td >
|
<td >
|
||||||
<input type="number" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" disabled placeholder="0" class="layui-input" value="{$data.margin}">
|
<input type="number" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" disabled placeholder="0" class="layui-input" value="{$data.margin}">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td >单位:元</td>
|
<td >单位:元</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="layui-td-gray">保证金扣除金额<font>*</font></td>
|
<td colspan="2" class="layui-td-gray">保证金扣除金额<font>*</font></td>
|
||||||
<td >
|
<td >
|
||||||
<input type="number" name="number" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="">
|
<input type="number" name="number" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="">
|
||||||
</td>
|
</td>
|
||||||
<td >单位:元</td>
|
<td >单位:元</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="layui-td-gray">保证金扣除原因<font>*</font></td>
|
<td colspan="2" class="layui-td-gray">保证金扣除原因<font>*</font></td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<textarea class="layui-textarea" name="mark"></textarea>
|
<textarea class="layui-textarea" name="mark"></textarea>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="pt-3">
|
<div class="pt-3">
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type='button'>扣除保证金</button>
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type='button'>扣除保证金</button>
|
||||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
|
|
||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script src="/static/assets/js/xm-select.js"></script>
|
<script src="/static/assets/js/xm-select.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var moduleInit = ['tool','treeGrid', 'tagpicker', 'tinymce', 'admin'];
|
var moduleInit = ['tool','treeGrid', 'tagpicker', 'tinymce', 'admin'];
|
||||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||||
|
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var treeGrid = layui.treeGrid,table = layui.table
|
var treeGrid = layui.treeGrid,table = layui.table
|
||||||
|
|
||||||
var tool = layui.tool;
|
var tool = layui.tool;
|
||||||
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||||
|
|
||||||
var editor = layui.tinymce;
|
var editor = layui.tinymce;
|
||||||
var edit = editor.render({
|
var edit = editor.render({
|
||||||
selector: "#container_content",
|
selector: "#container_content",
|
||||||
height: 500,
|
height: 500,
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听提交
|
//监听提交
|
||||||
form.on('submit(webform)', function (data) {
|
form.on('submit(webform)', function (data) {
|
||||||
// console.log(data.field);
|
// console.log(data.field);
|
||||||
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||||
if (data.field == '') {
|
if (data.field == '') {
|
||||||
layer.msg('请先完善表单输入');
|
layer.msg('请先完善表单输入');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let callback = function (e) {
|
let callback = function (e) {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
tool.tabRefresh(71);
|
tool.tabRefresh(71);
|
||||||
tool.sideClose(1000);
|
tool.sideClose(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tool.post('/admin/margin/reduct', data.field, callback);
|
tool.post('/admin/margin/reduct', data.field, callback);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
||||||
|
@ -15,29 +15,29 @@
|
|||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<label class="layui-form-label">选择时间</label>
|
<label class="layui-form-label">选择时间</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-btn-group">
|
<div class="layui-btn-group" id="witch_date">
|
||||||
<input id="chonse_start_date" type="hidden" name="start_date" value="" readonly placeholder="选择时间">
|
<button name="both" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||||
<input id="chonse_end_date" type="hidden" name="end_date" value="" readonly placeholder="选择时间">
|
<button name="today" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
||||||
<button id="both" name="both" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal">全部</button>
|
<button name="yeserday" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
||||||
<button name="today" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
||||||
<button name="yeserday" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
||||||
<button name="week" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
||||||
<button name="30day" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
||||||
<button name="month" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
|
||||||
<button name="year" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<!-- <label class="layui-form-label">日期范围</label> -->
|
<!-- <label class="layui-form-label">日期范围</label> -->
|
||||||
<div class="layui-inline" id="range_date">
|
<div class="layui-inline" id="test6">
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" autocomplete="off" name="start_date" id="start-date" class="layui-input" placeholder="开始日期">
|
<input type="text" autocomplete="off" name="start_date" id="test-startDate-1" class="layui-input"
|
||||||
|
placeholder="开始日期">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-mid">-</div>
|
<div class="layui-form-mid">-</div>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="text" autocomplete="off" name="end_date" id="end-date" class="layui-input" placeholder="结束日期">
|
<input type="text" autocomplete="off" name="end_date" id="test-endDate-1" class="layui-input"
|
||||||
|
placeholder="结束日期">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -46,14 +46,14 @@
|
|||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;">
|
<div class="layui-inline" style="width:46%">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">关键字</label>
|
<label class="layui-form-label">关键字</label>
|
||||||
<div class="layui-input-block" style="display:flex">
|
<div class="layui-input-block">
|
||||||
<input style="width:70%;float:left" type="text" name="keyword" placeholder="请输入关键字"
|
<input style="width:80%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
||||||
class="layui-input" autocomplete="off" />
|
class="layui-input" autocomplete="off" />
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit=""
|
<button class="layui-btn layui-btn-normal" style="width:20%" lay-submit=""
|
||||||
lay-filter="searchform">提交搜索</button>
|
lay-filter="searchform" type="button">提交搜索</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -62,10 +62,10 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商户类别</label>
|
<label class="layui-form-label">商户类别</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="is_trader" lay-filter="searchform">
|
<select name="dddd" lay-filter="searchform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="1">自营</option>
|
<option value="10">自营</option>
|
||||||
<option value="0">非自营</option>
|
<option value="11">非自营</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -75,29 +75,33 @@
|
|||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;float:none;">
|
<div class="layui-input-inline" style="width:46%;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商户分类</label>
|
<label class="layui-form-label">商户分类</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="category_id" lay-filter="seleform">
|
<select name="category" lay-filter="searchform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
{volist name="category" key="k" id="vo"}
|
<option value="0">写作</option>
|
||||||
<option value="{$vo.merchant_category_id}">{$vo.category_name}</option>
|
<option value="1">阅读</option>
|
||||||
{/volist}
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;">
|
<div class="layui-input-inline" style="width:35%;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">店铺类型</label>
|
<label class="layui-form-label">店铺类型</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="type_id" lay-filter="seleform">
|
<select name="type" lay-filter="type">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
{volist name="type" key="k" id="vo"}
|
<option value="0">写作</option>
|
||||||
<option value="{$vo.mer_type_id}">{$vo.type_name}</option>
|
<option value="1">阅读</option>
|
||||||
{/volist}
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -112,10 +116,13 @@
|
|||||||
|
|
||||||
<label class="layui-form-label">保证金状态</label>
|
<label class="layui-form-label">保证金状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select class="is_margin" name="is_margin" lay-filter="seleform">
|
<select class="test_state" name="status" lay-filter="status">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="10">已付</option>
|
<option value="0">写作</option>
|
||||||
<option value="0">未付</option>
|
<option value="1">阅读</option>
|
||||||
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -127,18 +134,19 @@
|
|||||||
<!-- change tab -->
|
<!-- change tab -->
|
||||||
<div class="layui-form-item" id="refund_margin" style="display:none;">
|
<div class="layui-form-item" id="refund_margin" style="display:none;">
|
||||||
|
|
||||||
<div class="layui-input-inline" style="width:45%;">
|
<div class="layui-input-inline" style="width:46%;">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<label class="layui-form-label">审核</label>
|
<label class="layui-form-label">审核</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-btn-group">
|
<div class="layui-btn-group">
|
||||||
<input type="hidden" id="status" name="status" value="" readonly placeholder="核审状态值">
|
<button type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||||
<button name="both" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
||||||
<button name="wait" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">已审核</button>
|
||||||
<button name="success" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核通过</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核失败</button>
|
||||||
<button name="failed" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核未通过</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -147,10 +155,13 @@
|
|||||||
|
|
||||||
<label class="layui-form-label">退回状态</label>
|
<label class="layui-form-label">退回状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="refund" lay-filter="seleform">
|
<select name="refund" lay-filter="refund">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="0">未退回</option>
|
<option value="0">写作</option>
|
||||||
<option value="1">已退回</option>
|
<option value="1">阅读</option>
|
||||||
|
<option value="2">游戏</option>
|
||||||
|
<option value="3">音乐</option>
|
||||||
|
<option value="4">旅行</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -167,14 +178,14 @@
|
|||||||
|
|
||||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||||
<ul class="layui-tab-title">
|
<ul class="layui-tab-title">
|
||||||
<li lay-id="11" class="layui-this tag-switch" data-type="tabChange">缴存保证金</li>
|
<li lay-id="11" class="layui-this site-demo-active" data-type="tabChange">缴存保证金</li>
|
||||||
<li lay-id="22" class="tag-switch" data-type="tabChange">退回保证金</li>
|
<li lay-id="22" class="site-demo-active" data-type="tabChange">退回保证金</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="layui-tab-content" style="height: 100px;">
|
<div class="layui-tab-content" style="height: 100px;">
|
||||||
|
|
||||||
<!-- 缴存列表 -->
|
<!-- 缴存列表 -->
|
||||||
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
||||||
<table class="layui-hide" id="pay_list" lay-filter="pay_list">
|
<table class="layui-hide" id="reduct_list" lay-filter="reduct_list">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -221,8 +232,8 @@
|
|||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||||
|
|
||||||
layui.payTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#pay_list',
|
elem: '#reduct_list',
|
||||||
title: '保证金列表',
|
title: '保证金列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: '/admin/margin/lst',
|
url: '/admin/margin/lst',
|
||||||
@ -249,7 +260,7 @@
|
|||||||
title: '店铺类型',
|
title: '店铺类型',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 220,
|
width: 220,
|
||||||
templet: '<div>{{d.merchant.merchantType.type_name}}</div>'
|
templet: '<div>{{d.merchant.type_id}}</div>'
|
||||||
}, {
|
}, {
|
||||||
field: 'real_name',
|
field: 'real_name',
|
||||||
title: '商户姓名',
|
title: '商户姓名',
|
||||||
@ -266,22 +277,7 @@
|
|||||||
field: 'status',
|
field: 'status',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 150,
|
width: 150
|
||||||
templet: function(d){
|
|
||||||
switch (d.merchant.is_margin) {
|
|
||||||
case 0:
|
|
||||||
return '<div>无</div>'
|
|
||||||
case 1:
|
|
||||||
return '<div>有未支付</div>'
|
|
||||||
case 10:
|
|
||||||
return '<div>已支付</div>'
|
|
||||||
case -1:
|
|
||||||
return '<div>申请退款</div>'
|
|
||||||
case -10:
|
|
||||||
return '<div>拒绝退款</div>'
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
field: 'pay_time',
|
field: 'pay_time',
|
||||||
title: '支付时间',
|
title: '支付时间',
|
||||||
@ -302,7 +298,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
layui.refundTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#refund_list',
|
elem: '#refund_list',
|
||||||
title: '退回保证金列表',
|
title: '退回保证金列表',
|
||||||
toolbar: '#refundToolbar',
|
toolbar: '#refundToolbar',
|
||||||
@ -378,10 +374,32 @@
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var $ = layui.$, active = {
|
||||||
|
reload: function(){
|
||||||
|
let dataRload = getformdata();;
|
||||||
|
|
||||||
|
//执行重载
|
||||||
|
table.reload('testReload', {
|
||||||
|
page: {
|
||||||
|
curr: 1 //重新从第 1 页开始
|
||||||
|
}
|
||||||
|
,where: {
|
||||||
|
...dataRload
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//监听表头工具栏事件
|
||||||
|
// table.on('toolbar(store_product)', function (obj) {
|
||||||
|
// if (obj.event === 'add') {
|
||||||
|
// tool.side("/admin/merchant/type/form");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
//监听表格行工具事件
|
//监听表格行工具事件
|
||||||
table.on('tool(pay_list)', function (obj) {
|
table.on('tool(reduct_list)', function (obj) {
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
if (obj.event === 'reduct') {
|
if (obj.event === 'reduct') {
|
||||||
@ -407,233 +425,97 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//触发事件
|
|
||||||
var $ = layui.$, active = {
|
|
||||||
tabChange: function(){
|
|
||||||
//切换到指定Tab项
|
|
||||||
// element.tabChange('demo', this.getAttribute('lay-id')); //切换tab
|
|
||||||
var marign = document.getElementById('set_margin');
|
|
||||||
var refund = document.getElementById('refund_margin');
|
|
||||||
if ('11'==this.getAttribute('lay-id')) {
|
|
||||||
marign.style.display = "block";
|
|
||||||
refund.style.display = "none";
|
|
||||||
}else{
|
|
||||||
refund.style.display = "block";
|
|
||||||
marign.style.display = "none";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reload: function(){
|
|
||||||
let dataRload = getformdata();
|
|
||||||
|
|
||||||
//执行重载
|
|
||||||
table.reload('pay_list', {
|
|
||||||
page: {
|
|
||||||
curr: 1 //重新从第 1 页开始
|
|
||||||
}
|
|
||||||
,where: {
|
|
||||||
...dataRload
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
refund_reload: ()=>{
|
|
||||||
let dataRload = getformdata();
|
|
||||||
|
|
||||||
//执行重载
|
|
||||||
table.reload('refund_list', {
|
|
||||||
page: {
|
|
||||||
curr: 1 //重新从第 1 页开始
|
|
||||||
}
|
|
||||||
,where: {
|
|
||||||
...dataRload
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
//监听搜索提交
|
||||||
|
form.on('submit(searchform)', function(data) {
|
||||||
|
console.log(data.elem.name, data.field)
|
||||||
|
layui.pageTable.reload({
|
||||||
|
where: {
|
||||||
|
date:data.elem.name,
|
||||||
|
...data.field
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
curr: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// layui.form.render();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
layui.use(['laydate','element','table', 'jquery'],
|
form.on('select(searchform)', function(e) {
|
||||||
|
let data = getformdata();
|
||||||
|
layui.pageTable.reload({
|
||||||
|
where: {
|
||||||
|
...data
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
curr: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听
|
||||||
|
$('.test_state .layui-btn').on('click', function(){
|
||||||
|
var type = $(this).data('type');
|
||||||
|
active[type] ? active[type].call(this) : '';
|
||||||
|
});
|
||||||
|
|
||||||
|
// 日期范围
|
||||||
|
layui.use(['laydate','element', 'jquery'],
|
||||||
function () {
|
function () {
|
||||||
var laydate = layui.laydate;
|
var laydate = layui.laydate;
|
||||||
var $ = layui.jquery,element = layui.element;
|
var $ = layui.jquery,element = layui.element;
|
||||||
|
|
||||||
//日期范围
|
//日期范围
|
||||||
laydate.render({
|
laydate.render({
|
||||||
elem: '#range_date'
|
elem: '#test6'
|
||||||
//设置开始日期、日期日期的 input 选择器
|
//设置开始日期、日期日期的 input 选择器
|
||||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||||
, range: ['#start-date', '#end-date']
|
, range: ['#test-startDate-1', '#test-endDate-1']
|
||||||
,done: function(value, date, endDate){
|
,done: function(value, date, endDate){
|
||||||
switchDateForm(true);
|
let data = getformdata()
|
||||||
|
data.date = ''
|
||||||
$('#both').removeClass('layui-btn-primary')
|
layui.pageTable.reload({
|
||||||
$('#both').siblings().addClass('layui-btn-primary')
|
where: {
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
...data
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
curr: 1
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//触发事件
|
||||||
|
var active = {
|
||||||
|
tabChange: function(){
|
||||||
|
//切换到指定Tab项
|
||||||
|
// element.tabChange('demo', this.getAttribute('lay-id')); //切换tab
|
||||||
|
var marign = document.getElementById('set_margin');
|
||||||
|
var refund = document.getElementById('refund_margin');
|
||||||
|
if ('11'==this.getAttribute('lay-id')) {
|
||||||
|
marign.style.display = "block";
|
||||||
|
refund.style.display = "none";
|
||||||
|
// refund.childNodes().value='';
|
||||||
|
}else{
|
||||||
|
refund.style.display = "block";
|
||||||
|
marign.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$('.site-demo-active').on('click', function(){
|
||||||
// 列表切换
|
|
||||||
$('.tag-switch').on('click', function(){
|
|
||||||
var othis = $(this), type = othis.data('type');
|
var othis = $(this), type = othis.data('type');
|
||||||
active[type] ? active[type].call(this, othis) : '';
|
active[type] ? active[type].call(this, othis) : '';
|
||||||
if ('11'==this.getAttribute('lay-id')) {
|
|
||||||
active['reload'] ? active['reload'].call(this, othis) : '';
|
|
||||||
}else{
|
|
||||||
active['refund_reload'] ? active['refund_reload'].call(this, othis) : '';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//监听button提交
|
|
||||||
form.on('submit(searchform)', function(data) {
|
|
||||||
layui.payTable.reload({
|
|
||||||
where: {
|
|
||||||
...data.field
|
|
||||||
},
|
|
||||||
page: {
|
|
||||||
curr: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
form.on('select(searchform)', function(e) {
|
|
||||||
let data = getformdata();
|
|
||||||
layui.payTable.reload({
|
|
||||||
where: {
|
|
||||||
...data
|
|
||||||
},
|
|
||||||
page: {
|
|
||||||
curr: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//选择时间
|
//Hash地址的定位
|
||||||
form.on('submit(chonse_date)', function(data){
|
// var layid = location.hash.replace(/^#test=/, '');
|
||||||
let start_date = '';
|
// element.tabChange('test', layid);
|
||||||
let end_date = getDaysAgo();
|
|
||||||
|
|
||||||
let name = data.elem.name;
|
|
||||||
if (name =='today') {
|
|
||||||
start_date=end_date;
|
|
||||||
end_date = getDaysAgo(-1);
|
|
||||||
}else if(name == 'yeserday'){
|
|
||||||
start_date = getDaysAgo(1);
|
|
||||||
}else if(name == 'week'){
|
|
||||||
start_date = getDaysAgo(7);
|
|
||||||
}else if(name == '30day'){
|
|
||||||
start_date = getDaysAgo(30);
|
|
||||||
}else if(name == 'month'){
|
|
||||||
let days = (new Date).getDate()-1
|
|
||||||
start_date = getDaysAgo(days);
|
|
||||||
}else if(name == 'year'){
|
|
||||||
var year = (new Date()).getFullYear();//获取当前年份
|
|
||||||
start_date = year+'-01-01'
|
|
||||||
}else{
|
|
||||||
end_date = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
switchClass(this)
|
|
||||||
|
|
||||||
switchDateForm(false);
|
|
||||||
$('#chonse_start_date').val(start_date);
|
|
||||||
$('#chonse_end_date').val(end_date);
|
|
||||||
|
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
|
||||||
|
|
||||||
return false;
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// 商户审核
|
|
||||||
form.on('submit(statusform)', function(data) {
|
|
||||||
let name = data.elem.name
|
|
||||||
let status = 0;
|
|
||||||
|
|
||||||
if (name=='wait') {
|
|
||||||
status = 0;
|
|
||||||
}else if(name=='success'){
|
|
||||||
status = 1;
|
|
||||||
}else if(name=='failed'){
|
|
||||||
status = 2;
|
|
||||||
}
|
|
||||||
if (name=='both'){
|
|
||||||
$('#status').attr('disabled', true);
|
|
||||||
}else{
|
|
||||||
$('#status').attr('disabled', false);
|
|
||||||
}
|
|
||||||
switchClass(this)
|
|
||||||
$('#status').val(status);
|
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
//监听select提交
|
|
||||||
form.on('select(seleform)', function(data) {
|
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// 切换button选中样式
|
|
||||||
function switchClass(e)
|
|
||||||
{
|
|
||||||
$(e).removeClass('layui-btn-primary')
|
|
||||||
$(e).siblings().addClass('layui-btn-primary')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 两个时间表单是互斥的,只能提交一个
|
|
||||||
function switchDateForm(chonse=false)
|
|
||||||
{
|
|
||||||
let range = chonse?false:true;
|
|
||||||
$('#start-date').attr("disabled",range);
|
|
||||||
$('#end-date').attr("disabled",range);
|
|
||||||
|
|
||||||
$('#chonse_start_date').attr("disabled",chonse);
|
|
||||||
$('#chonse_end_date').attr("disabled",chonse);
|
|
||||||
if (chonse) {
|
|
||||||
$('#chonse_start_date').val("");
|
|
||||||
$('#chonse_end_date').val("");
|
|
||||||
}else{
|
|
||||||
$('#start-date').val("");
|
|
||||||
$('#end-date').val("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取n天以前日期
|
|
||||||
function getDaysAgo(n=0) {
|
|
||||||
let myDate = new Date();
|
|
||||||
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * n); //最后一个数字30可改,n天前的意思
|
|
||||||
let lastY = lw.getFullYear();
|
|
||||||
let lastM = lw.getMonth() + 1;
|
|
||||||
let lastD = lw.getDate();
|
|
||||||
lastM = lastM < 10 ? "0" + lastM : lastM;
|
|
||||||
lastD = lastD < 10 ? "0" + lastD : lastD;
|
|
||||||
let startData = lastY+"-"+lastM+"-" +lastD; //n天之前日期
|
|
||||||
|
|
||||||
return startData;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取表单所有参数
|
|
||||||
function getformdata() {
|
|
||||||
var form = $('#filterform').serializeArray();
|
|
||||||
var data = new Array();
|
|
||||||
for(let i=0;i<form.length; i++){
|
|
||||||
data[form[i].name] = form[i].value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,102 +1,102 @@
|
|||||||
{extend name="common/base"/}
|
{extend name="common/base"/}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
|
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
|
|
||||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||||
<ul class="layui-tab-title">
|
<ul class="layui-tab-title">
|
||||||
<li class="layui-this">扣费记录</li>
|
<li class="layui-this">扣费记录</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="layui-tab-content" style="height: 100px;">
|
<div class="layui-tab-content" style="height: 100px;">
|
||||||
|
|
||||||
<!-- 缴存列表 -->
|
<!-- 缴存列表 -->
|
||||||
<div class="layui-tab-item layui-show">
|
<div class="layui-tab-item layui-show">
|
||||||
<table class="layui-hide" id="reduct_list" lay-filter="reduct_list">
|
<table class="layui-hide" id="reduct_list" lay-filter="reduct_list">
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
function GetQueryString(name) {
|
function GetQueryString(name) {
|
||||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||||
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
|
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
|
||||||
var context = "";
|
var context = "";
|
||||||
if (r != null)
|
if (r != null)
|
||||||
context = decodeURIComponent(r[2]);
|
context = decodeURIComponent(r[2]);
|
||||||
reg = null;
|
reg = null;
|
||||||
r = null;
|
r = null;
|
||||||
return context == null || context == "" || context == "undefined" ? "" : context;
|
return context == null || context == "" || context == "undefined" ? "" : context;
|
||||||
}
|
}
|
||||||
// alert(GetQueryString("id"));
|
// alert(GetQueryString("id"));
|
||||||
|
|
||||||
const moduleInit = ['tool'];
|
const moduleInit = ['tool'];
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#reduct_list',
|
elem: '#reduct_list',
|
||||||
title: '扣费记录',
|
title: '扣费记录',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: '/admin/margin/reductlst?id='+GetQueryString("id"),
|
url: '/admin/margin/reductlst?id='+GetQueryString("id"),
|
||||||
parseData: function(res){ //res 即为原始返回的数据
|
parseData: function(res){ //res 即为原始返回的数据
|
||||||
return {
|
return {
|
||||||
"code": res.code, //解析接口状态
|
"code": res.code, //解析接口状态
|
||||||
"msg": res.msg, //解析提示文本
|
"msg": res.msg, //解析提示文本
|
||||||
"count": res.data.count, //解析数据长度
|
"count": res.data.count, //解析数据长度
|
||||||
"data": res.data.list //解析数据列表
|
"data": res.data.list //解析数据列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
page: true,
|
page: true,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
cellMinWidth: 300,
|
cellMinWidth: 300,
|
||||||
cols: [
|
cols: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
fixed: 'ID',
|
fixed: 'ID',
|
||||||
field: 'bill_id',
|
field: 'bill_id',
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 80
|
width: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'mark',
|
field: 'mark',
|
||||||
title: '扣费原因',
|
title: '扣费原因',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 500,
|
width: 500,
|
||||||
},{
|
},{
|
||||||
field: 'number',
|
field: 'number',
|
||||||
title: '扣费金额',
|
title: '扣费金额',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 200,
|
width: 200,
|
||||||
},{
|
},{
|
||||||
field: 'create_time',
|
field: 'create_time',
|
||||||
title: '操作时间',
|
title: '操作时间',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 200
|
width: 200
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// 日期范围
|
// 日期范围
|
||||||
// layui.use('laydate', function () {
|
// layui.use('laydate', function () {
|
||||||
// var laydate = layui.laydate;
|
// var laydate = layui.laydate;
|
||||||
// //日期范围
|
// //日期范围
|
||||||
// laydate.render({
|
// laydate.render({
|
||||||
// elem: '#test6'
|
// elem: '#test6'
|
||||||
// //设置开始日期、日期日期的 input 选择器
|
// //设置开始日期、日期日期的 input 选择器
|
||||||
// //数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
// //数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||||
// , range: ['#test-startDate-1', '#test-endDate-1']
|
// , range: ['#test-startDate-1', '#test-endDate-1']
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -1,63 +1,63 @@
|
|||||||
{extend name="common/base"/}
|
{extend name="common/base"/}
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
<style>
|
<style>
|
||||||
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||||
</style>
|
</style>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<div class="layui-form p-4">
|
<div class="layui-form p-4">
|
||||||
<h3 class="pb-3">查看店铺类型</h3>
|
<h3 class="pb-3">查看店铺类型</h3>
|
||||||
<table class="layui-table layui-table-form">
|
<table class="layui-table layui-table-form">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">店铺类型名称</td>
|
<td class="layui-td-gray">店铺类型名称</td>
|
||||||
<td colspan="7"><input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
<td colspan="7"><input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}" readonly></td>
|
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}" readonly></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">店铺类型要求</td>
|
<td class="layui-td-gray">店铺类型要求</td>
|
||||||
<td colspan="7">
|
<td colspan="7">
|
||||||
<input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
<input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_info}" readonly>
|
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_info}" readonly>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">店铺保证金</td>
|
<td class="layui-td-gray">店铺保证金</td>
|
||||||
<td colspan="7"><input type="text" name="price" lay-verify="required" lay-reqText="请输入商品关键字"
|
<td colspan="7"><input type="text" name="price" lay-verify="required" lay-reqText="请输入商品关键字"
|
||||||
autocomplete="off" placeholder="请输入商品关键字" class="layui-input" value="{$detail.margin}" readonly></td>
|
autocomplete="off" placeholder="请输入商品关键字" class="layui-input" value="{$detail.margin}" readonly></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray">店铺权限</td>
|
<td class="layui-td-gray">店铺权限</td>
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray" style="text-align:left">其它说明</td>
|
<td class="layui-td-gray" style="text-align:left">其它说明</td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
<textarea class="layui-textarea" name="store_info" readonly>{$detail.store_info}</textarea>
|
<textarea class="layui-textarea" name="store_info" readonly>{$detail.store_info}</textarea>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray" style="text-align:left">创建时间</td>
|
<td class="layui-td-gray" style="text-align:left">创建时间</td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
{$detail.create_time}
|
{$detail.create_time}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="layui-td-gray" style="text-align:left">修改时间</td>
|
<td class="layui-td-gray" style="text-align:left">修改时间</td>
|
||||||
<td colspan="6">
|
<td colspan="6">
|
||||||
{$detail.update_time}
|
{$detail.update_time}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
@ -37,15 +37,15 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input lay-filter="is_margin"type="radio" name="is_margin" value="1" title="有" {if $detail.is_margin == 1}checked{/if}>
|
<input type="radio" name="is_margin" value="1" title="有" checked="{$detail.is_margin}">
|
||||||
<input lay-filter="is_margin" type="radio" name="is_margin" value="0" title="无" {if $detail.is_margin == 0}checked{/if}>
|
<input type="radio" name="is_margin" value="0" title="无" checked="{$detail.is_margin}">
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="5"></td>
|
<td colspan="5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<input id="margin" type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="{$detail.margin}">
|
<input type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="{$detail.margin}">
|
||||||
</td>
|
</td>
|
||||||
<td colspan="5">单位:元</td>
|
<td colspan="5">单位:元</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -116,34 +116,14 @@
|
|||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
let tval = '';
|
|
||||||
form.on('radio(is_margin)', (data)=>{
|
|
||||||
if (data.value>0) {
|
|
||||||
$('#margin').val(tval);
|
|
||||||
$('#margin').attr({'disabled':false});
|
|
||||||
}else{
|
|
||||||
tval = $('#margin').val();
|
|
||||||
$('#margin').val('');
|
|
||||||
$('#margin').attr('disabled',true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//监听提交
|
//监听提交
|
||||||
form.on('submit(webform)', function (data) {
|
form.on('submit(webform)', function (data) {
|
||||||
|
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||||
if (data.field == '') {
|
if (data.field == '') {
|
||||||
layer.msg('请先完善店铺类型');
|
layer.msg('请先完善店铺类型');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (data.field.is_margin) {
|
|
||||||
if (data.field.margin <1) {
|
|
||||||
layer.msg('请输入店铺压金');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
data.field.margin = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
let callback = function (e) {
|
let callback = function (e) {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
|
@ -1,437 +1,437 @@
|
|||||||
{extend name="common/base"/}
|
{extend name="common/base"/}
|
||||||
<!-- 主体 -->
|
<!-- 主体 -->
|
||||||
{block name="body"}
|
{block name="body"}
|
||||||
<style>
|
<style>
|
||||||
.layui-input-inline{
|
.layui-input-inline{
|
||||||
width:35% !important;
|
width:35% !important;
|
||||||
}
|
}
|
||||||
.layui-input-inline .layui-form-item{
|
.layui-input-inline .layui-form-item{
|
||||||
display:flex;
|
display:flex;
|
||||||
}
|
}
|
||||||
.layui-input-inline .layui-form-item .layui-form-label{
|
.layui-input-inline .layui-form-item .layui-form-label{
|
||||||
width:30%;
|
width:30%;
|
||||||
}
|
}
|
||||||
.layui-input-block{
|
.layui-input-block{
|
||||||
margin-left:unset !important;
|
margin-left:unset !important;
|
||||||
width:75%;
|
width:75%;
|
||||||
}
|
}
|
||||||
#seleform{
|
#seleform{
|
||||||
border-color: #eee;
|
border-color: #eee;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color:#a39f9f;
|
color:#a39f9f;
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<div class="layui-form">
|
<div class="layui-form">
|
||||||
<form id="filterform" class="layui-form gg-form-bar border-t border-x" >
|
<form id="filterform" class="layui-form gg-form-bar border-t border-x" >
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">平台商品分类</label>
|
<label class="layui-form-label">平台商品分类</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select id="plate_cate" name="plate_cate" lay-filter="seleform">
|
<select id="plate_cate" name="plate_cate" lay-filter="seleform">
|
||||||
<option value="">请选择商品分类</option>
|
<option value="">请选择商品分类</option>
|
||||||
{volist name="$cate_list" id="v"}
|
{volist name="$cate_list" id="v"}
|
||||||
<option value="{$v.id}" >{$v.title}{$v.cate_name} </option>
|
<option value="{$v.id}" >{$v.title}{$v.cate_name} </option>
|
||||||
{/volist}
|
{/volist}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商户商品分类</label>
|
<label class="layui-form-label">商户商品分类</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input id="store_cate" type="hidden" readonly="readonly" name="store_cate">
|
<input id="store_cate" type="hidden" readonly="readonly" name="store_cate">
|
||||||
<button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>
|
<button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">是否为礼包</label>
|
<label class="layui-form-label">是否为礼包</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="is_gift" lay-filter="seleform">
|
<select name="is_gift" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="0">是</option>
|
<option value="0">是</option>
|
||||||
<option value="1">否</option>
|
<option value="1">否</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">商品状态</label>
|
<label class="layui-form-label">商品状态</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="state" lay-filter="seleform">
|
<select name="state" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="1">上架</option>
|
<option value="1">上架</option>
|
||||||
<option value="0">下架</option>
|
<option value="0">下架</option>
|
||||||
<option value="2">平台关闭</option>
|
<option value="2">平台关闭</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
|
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">标签</label>
|
<label class="layui-form-label">标签</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="tag" lay-filter="seleform" data-type="reload">
|
<select name="tag" lay-filter="seleform" data-type="reload">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="0">写作</option>
|
<option value="0">写作</option>
|
||||||
<option value="1">阅读</option>
|
<option value="1">阅读</option>
|
||||||
<option value="2">游戏</option>
|
<option value="2">游戏</option>
|
||||||
<option value="3">音乐</option>
|
<option value="3">音乐</option>
|
||||||
<option value="4">旅行</option>
|
<option value="4">旅行</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">运费模板</label>
|
<label class="layui-form-label">运费模板</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="shipping_tem" lay-filter="seleform">
|
<select name="shipping_tem" lay-filter="seleform">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="0">写作</option>
|
<option value="0">写作</option>
|
||||||
<option value="1">阅读</option>
|
<option value="1">阅读</option>
|
||||||
<option value="2">游戏</option>
|
<option value="2">游戏</option>
|
||||||
<option value="3">音乐</option>
|
<option value="3">音乐</option>
|
||||||
<option value="4">旅行</option>
|
<option value="4">旅行</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-input-inline" style="display:flex;">
|
<div class="layui-input-inline" style="display:flex;">
|
||||||
<label class="layui-form-label">关键字搜索</label>
|
<label class="layui-form-label">关键字搜索</label>
|
||||||
|
|
||||||
<div class="layui-input-block" style="display:flex">
|
<div class="layui-input-block" style="display:flex">
|
||||||
<div class="layui-input-inline" style="width: 78% !important">
|
<div class="layui-input-inline" style="width: 78% !important">
|
||||||
<input type="text" name="keywords" placeholder="请输入商品名称、关键字" class="layui-input" autocomplete="off" />
|
<input type="text" name="keywords" placeholder="请输入商品名称、关键字" class="layui-input" autocomplete="off" />
|
||||||
</div>
|
</div>
|
||||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/html" id="status">
|
<script type="text/html" id="status">
|
||||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="is_home">
|
<script type="text/html" id="is_home">
|
||||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="thumb">
|
<script type="text/html" id="thumb">
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- <script type="text/html" id="toolbarDemo">
|
<!-- <script type="text/html" id="toolbarDemo">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加虚拟评论">+ 添加虚拟评论</span>
|
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加虚拟评论">+ 添加虚拟评论</span>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</script> -->
|
</script> -->
|
||||||
|
|
||||||
<script type="text/html" id="barDemo">
|
<script type="text/html" id="barDemo">
|
||||||
<div class="layui-btn-group">
|
<div class="layui-btn-group">
|
||||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||||
{/if}
|
{/if}
|
||||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||||
{/if}
|
{/if}
|
||||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /主体 -->
|
<!-- /主体 -->
|
||||||
|
|
||||||
<!-- 脚本 -->
|
<!-- 脚本 -->
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
<script>
|
<script>
|
||||||
const moduleInit = ['tool'];
|
const moduleInit = ['tool'];
|
||||||
function gouguInit() {
|
function gouguInit() {
|
||||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||||
|
|
||||||
layui.pageTable = table.render({
|
layui.pageTable = table.render({
|
||||||
elem: '#article',
|
elem: '#article',
|
||||||
title: '列表',
|
title: '列表',
|
||||||
toolbar: '#toolbarDemo',
|
toolbar: '#toolbarDemo',
|
||||||
url: '{$url[0]}',
|
url: '{$url[0]}',
|
||||||
page: true,
|
page: true,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
cols: [
|
cols: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
field: 'product_id',
|
field: 'product_id',
|
||||||
title: '编号',
|
title: '编号',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:80,
|
width:80,
|
||||||
},{
|
},{
|
||||||
field: 'image',
|
field: 'image',
|
||||||
title: '商品图',
|
title: '商品图',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:120,
|
width:120,
|
||||||
templet: function (d)
|
templet: function (d)
|
||||||
{
|
{
|
||||||
var html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
var html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||||
<img style="width:100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAACUCAYAAAB1GVf9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABBKADAAQAAAABAAAAlAAAAAD7OG/zAAAH8ElEQVR4Ae3dWXPUOBQGUGcYoKCAByi2///f2LewE5bAzVSXIBPfdu8y9/gFpdVedKT+4pbtcHRycnI6WAgQIPBL4B8KBAgQWAgIhIWEfwkQcIZgDBAg0AScITQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBP5tRaW5CLx//374+PHjcHJyMnz//n24dOnScOXKleH69evDjRs35tIMx9mhwNGvQXXa4XE5pAsEvn79Orx8+XL48uXLBbX/vXT16tXhzp07w+XLl0ffo4LAmIBAGJPp7PUIgadPnw6np8vz++joaLh///4Q4WAhsIqAOYRVtA703giB58+fTwqDOMRV379Jsz5//jwcHx9vsgnrdiQgEDrqjLFDefv27dlcwVj9Ra/H3EKst8vl27dvZ0H15s2bs/mMXe7LtvcjIBD247zRXj59+rTW+uuuN2VncRby4sWL4cePH2dvj7kNy/wFBMIM+jCuJqyzrLvelH29evXqj8nN2FecKVjmLSAQ5t1/Bzn6d+/eDXHp8/wScwm7DKHz+/Pz9gUEwvZNt77FuMdgnWXd9bJ9xdWOODsYW3x1GJOZx+sCYQb9dO3atbWOct31xnYWE5VxtSNb4gzh9evX2VvUdSwgEDrunMWh3bp16+xuxMXPU/6NuxdjvalLXD5ctjx79mzS1Y64uuGrwzLNPusFQp/98sdRxY1Gd+/eHeLfKcuq74/T/Ljp6cOHD6Obj/es8iGPKxBTbqIa3aGKgwgIhIOwr77TuOvw4cOHS+8+nPq+xRHElYHFBGF8iOMZifNL1C/ec75u7Oe4zdpVhzGdfl9363K/fTN6ZPHh3MbDTbGdiyYB7927NyzmH2IS8cmTJ6PHsqziwYMHS0Ns2TbU709AIOzPuqs9RaBkE4TxLEQ8IPX48eNJ8wZjjYttxJnN1K87Y9vx+n4EBMJ+nLvay5QHpeIDHB/mVeYNxhp58+bN4fbt22PVXu9IwBxCR52xj0OJD3hcLVg24Rf12wiDaFPcyBQhZOlfQCD030dbO8J4GCnCYPH8wdY2PGFDrjpMQOrgLQKhg07YxyFECEy9j2AXxxNhlN3huIt92ubqAgJhdbPZrRGn/3GfQVwKPOQSVzWm3AB1yGOsvm+BUGAExNWEbc0HbMoVlzmXzV9sug/rry8gENa3m8Wa8QHc5d9FWBUhvjp41mFVtf29XyDsz3pre4r5gHjQaNkSH7xV7zBcts1t1MdVh55Cahtt+lu2IRBm1pPxQXr06NHZ3YPZnEB86Hb9J9Q2oYszl0Nc7djkmCusKxBm0svxvTtm6RdXCuLUO24pvuj6fjyk1PuMfpzh+OrQ3+ATCP31yf+OKCYE48Mfv/V/X+I3bFw9+P2BpJjFj2v+c1h6/DozB7ddHqP/uWmXulvYdoRA9ts+zhziKkL85yzxF5LiDMJCYF0BgbCu3I7Xi1PqVa4QxHvj+QOX9HbcMX/55gVChx0cXwHWmXQTBh125swOSSB01mERBL5bd9YphQ7HpGJnnS0MOuuQYocjEIp1uOYSyAQEQqajjkAxAYFQrMM1l0AmIBAyHXUEigkIhGIdrrkEMgGBkOmoI1BMwF9dLtbhmksgE3CGkOmoI1BMQCAU63DNJZAJCIRMRx2BYgICoViHay6BTEAgZDrqCBQTEAjFOlxzCWQCAiHTUUegmIBAKNbhmksgExAImY46AsUEBEKxDtdcApmAQMh01BEoJiAQinW45hLIBARCpqOOQDEBgVCswzWXQCYgEDIddQSKCQiEYh2uuQQyAYGQ6agjUExAIBTrcM0lkAkIhExHHYFiAgKhWIdrLoFMQCBkOuoIFBMQCMU6XHMJZAICIdNRR6CYgEAo1uGaSyATEAiZjjoCxQQEQrEO11wCmYBAyHTUESgmIBCKdbjmEsgEBEKmo45AMQGBUKzDNZdAJiAQMh11BIoJCIRiHa65BDIBgZDpqCNQTEAgFOtwzSWQCQiETEcdgWICAqFYh2sugUxAIGQ66ggUExAIxTpccwlkAgIh01FHoJiAQCjW4ZpLIBMQCJmOOgLFBARCsQ7XXAKZgEDIdNQRKCYgEIp1uOYSyAQEQqajjkAxAYFQrMM1l0AmIBAyHXUEigkIhGIdrrkEMgGBkOmoI1BMQCAU63DNJZAJCIRMRx2BYgICoViHay6BTEAgZDrqCBQTEAjFOlxzCWQCPwEYef7DpS5s4AAAAABJRU5ErkJggg==">
|
<img style="width:100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAACUCAYAAAB1GVf9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABBKADAAQAAAABAAAAlAAAAAD7OG/zAAAH8ElEQVR4Ae3dWXPUOBQGUGcYoKCAByi2///f2LewE5bAzVSXIBPfdu8y9/gFpdVedKT+4pbtcHRycnI6WAgQIPBL4B8KBAgQWAgIhIWEfwkQcIZgDBAg0AScITQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBP5tRaW5CLx//374+PHjcHJyMnz//n24dOnScOXKleH69evDjRs35tIMx9mhwNGvQXXa4XE5pAsEvn79Orx8+XL48uXLBbX/vXT16tXhzp07w+XLl0ffo4LAmIBAGJPp7PUIgadPnw6np8vz++joaLh///4Q4WAhsIqAOYRVtA703giB58+fTwqDOMRV379Jsz5//jwcHx9vsgnrdiQgEDrqjLFDefv27dlcwVj9Ra/H3EKst8vl27dvZ0H15s2bs/mMXe7LtvcjIBD247zRXj59+rTW+uuuN2VncRby4sWL4cePH2dvj7kNy/wFBMIM+jCuJqyzrLvelH29evXqj8nN2FecKVjmLSAQ5t1/Bzn6d+/eDXHp8/wScwm7DKHz+/Pz9gUEwvZNt77FuMdgnWXd9bJ9xdWOODsYW3x1GJOZx+sCYQb9dO3atbWOct31xnYWE5VxtSNb4gzh9evX2VvUdSwgEDrunMWh3bp16+xuxMXPU/6NuxdjvalLXD5ctjx79mzS1Y64uuGrwzLNPusFQp/98sdRxY1Gd+/eHeLfKcuq74/T/Ljp6cOHD6Obj/es8iGPKxBTbqIa3aGKgwgIhIOwr77TuOvw4cOHS+8+nPq+xRHElYHFBGF8iOMZifNL1C/ec75u7Oe4zdpVhzGdfl9363K/fTN6ZPHh3MbDTbGdiyYB7927NyzmH2IS8cmTJ6PHsqziwYMHS0Ns2TbU709AIOzPuqs9RaBkE4TxLEQ8IPX48eNJ8wZjjYttxJnN1K87Y9vx+n4EBMJ+nLvay5QHpeIDHB/mVeYNxhp58+bN4fbt22PVXu9IwBxCR52xj0OJD3hcLVg24Rf12wiDaFPcyBQhZOlfQCD030dbO8J4GCnCYPH8wdY2PGFDrjpMQOrgLQKhg07YxyFECEy9j2AXxxNhlN3huIt92ubqAgJhdbPZrRGn/3GfQVwKPOQSVzWm3AB1yGOsvm+BUGAExNWEbc0HbMoVlzmXzV9sug/rry8gENa3m8Wa8QHc5d9FWBUhvjp41mFVtf29XyDsz3pre4r5gHjQaNkSH7xV7zBcts1t1MdVh55Cahtt+lu2IRBm1pPxQXr06NHZ3YPZnEB86Hb9J9Q2oYszl0Nc7djkmCusKxBm0svxvTtm6RdXCuLUO24pvuj6fjyk1PuMfpzh+OrQ3+ATCP31yf+OKCYE48Mfv/V/X+I3bFw9+P2BpJjFj2v+c1h6/DozB7ddHqP/uWmXulvYdoRA9ts+zhziKkL85yzxF5LiDMJCYF0BgbCu3I7Xi1PqVa4QxHvj+QOX9HbcMX/55gVChx0cXwHWmXQTBh125swOSSB01mERBL5bd9YphQ7HpGJnnS0MOuuQYocjEIp1uOYSyAQEQqajjkAxAYFQrMM1l0AmIBAyHXUEigkIhGIdrrkEMgGBkOmoI1BMwF9dLtbhmksgE3CGkOmoI1BMQCAU63DNJZAJCIRMRx2BYgICoViHay6BTEAgZDrqCBQTEAjFOlxzCWQCAiHTUUegmIBAKNbhmksgExAImY46AsUEBEKxDtdcApmAQMh01BEoJiAQinW45hLIBARCpqOOQDEBgVCswzWXQCYgEDIddQSKCQiEYh2uuQQyAYGQ6agjUExAIBTrcM0lkAkIhExHHYFiAgKhWIdrLoFMQCBkOuoIFBMQCMU6XHMJZAICIdNRR6CYgEAo1uGaSyATEAiZjjoCxQQEQrEO11wCmYBAyHTUESgmIBCKdbjmEsgEBEKmo45AMQGBUKzDNZdAJiAQMh11BIoJCIRiHa65BDIBgZDpqCNQTEAgFOtwzSWQCQiETEcdgWICAqFYh2sugUxAIGQ66ggUExAIxTpccwlkAgIh01FHoJiAQCjW4ZpLIBMQCJmOOgLFBARCsQ7XXAKZgEDIdNQRKCYgEIp1uOYSyAQEQqajjkAxAYFQrMM1l0AmIBAyHXUEigkIhGIdrrkEMgGBkOmoI1BMQCAU63DNJZAJCIRMRx2BYgICoViHay6BTEAgZDrqCBQTEAjFOlxzCWQCPwEYef7DpS5s4AAAAABJRU5ErkJggg==">
|
||||||
</div>`;
|
</div>`;
|
||||||
if(d.image)
|
if(d.image)
|
||||||
{
|
{
|
||||||
html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||||
<img style="width:100%;" src="` + d.image + `" />
|
<img style="width:100%;" src="` + d.image + `" />
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
field: 'store_name',
|
field: 'store_name',
|
||||||
title: '商品名称',
|
title: '商品名称',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:120
|
width:120
|
||||||
},{
|
},{
|
||||||
field: 'product_score',
|
field: 'product_score',
|
||||||
title: '商户类别',
|
title: '商户类别',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
templet: function (d)
|
templet: function (d)
|
||||||
{
|
{
|
||||||
return d.storeCategory ? d.storeCategory.cate_name : '待定';
|
return d.storeCategory ? d.storeCategory.cate_name : '待定';
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
field: 'price',
|
field: 'price',
|
||||||
title: '商品售价',
|
title: '商品售价',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
},{
|
},{
|
||||||
field: 'sales',
|
field: 'sales',
|
||||||
title: '销量',
|
title: '销量',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
},{
|
},{
|
||||||
field: 'stock',
|
field: 'stock',
|
||||||
title: '库存',
|
title: '库存',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
},{
|
},{
|
||||||
field: 'is_good',
|
field: 'is_good',
|
||||||
title: '推荐级别',
|
title: '推荐级别',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:120,
|
width:120,
|
||||||
},{
|
},{
|
||||||
field: 'sort',
|
field: 'sort',
|
||||||
title: '排序',
|
title: '排序',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:120,
|
width:120,
|
||||||
},{
|
},{
|
||||||
field: 'is_used',
|
field: 'is_used',
|
||||||
title: '是否显示',
|
title: '是否显示',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
templet: function (d)
|
templet: function (d)
|
||||||
{
|
{
|
||||||
var html = d.is_used ? '显示' : '隐藏';
|
var html = d.is_used ? '显示' : '隐藏';
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
field: 'is_show',
|
field: 'is_show',
|
||||||
title: '商品状态',
|
title: '商品状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
templet: function (d)
|
templet: function (d)
|
||||||
{
|
{
|
||||||
var html = d.is_show ? '上架显示' : '平台关闭';
|
var html = d.is_show ? '上架显示' : '平台关闭';
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
field: 'keyword',
|
field: 'keyword',
|
||||||
title: '标签',
|
title: '标签',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:150,
|
width:150,
|
||||||
},{
|
},{
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
field: 'right',
|
field: 'right',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
toolbar: '#barDemo',
|
toolbar: '#barDemo',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:180,
|
width:180,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听表头工具栏事件
|
//监听表头工具栏事件
|
||||||
table.on('toolbar(article)', function(obj){
|
table.on('toolbar(article)', function(obj){
|
||||||
if (obj.event === 'add') {
|
if (obj.event === 'add') {
|
||||||
tool.side('{$url[1]}');
|
tool.side('{$url[1]}');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听表格行工具事件
|
//监听表格行工具事件
|
||||||
table.on('tool(article)', function(obj) {
|
table.on('tool(article)', function(obj) {
|
||||||
var data = obj.data;
|
var data = obj.data;
|
||||||
if (obj.event === 'read') {
|
if (obj.event === 'read') {
|
||||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||||
}
|
}
|
||||||
else if (obj.event === 'edit') {
|
else if (obj.event === 'edit') {
|
||||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||||
}
|
}
|
||||||
else if (obj.event === 'del') {
|
else if (obj.event === 'del') {
|
||||||
layer.confirm('确定要删除该记录吗?', {
|
layer.confirm('确定要删除该记录吗?', {
|
||||||
icon: 3,
|
icon: 3,
|
||||||
title: '提示'
|
title: '提示'
|
||||||
}, function(index) {
|
}, function(index) {
|
||||||
let callback = function (e) {
|
let callback = function (e) {
|
||||||
layer.msg(e.msg);
|
layer.msg(e.msg);
|
||||||
if (e.code == 0) {
|
if (e.code == 0) {
|
||||||
obj.del();
|
obj.del();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tool.delete('{$url[3]}', { id: data.reply_id }, callback);
|
tool.delete('{$url[3]}', { id: data.reply_id }, callback);
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
layui.use(['rate','dropdown', 'util', 'layer', 'table'], function(){
|
layui.use(['rate','dropdown', 'util', 'layer', 'table'], function(){
|
||||||
var dropdown = layui.dropdown
|
var dropdown = layui.dropdown
|
||||||
,util = layui.util
|
,util = layui.util
|
||||||
,layer = layui.layer
|
,layer = layui.layer
|
||||||
,rate = layui.rate
|
,rate = layui.rate
|
||||||
// ,table = layui.table
|
// ,table = layui.table
|
||||||
,$ = layui.jquery;
|
,$ = layui.jquery;
|
||||||
|
|
||||||
var $ = layui.$, active = {
|
var $ = layui.$, active = {
|
||||||
reload: function(){
|
reload: function(){
|
||||||
let dataRload = getformdata();;
|
let dataRload = getformdata();;
|
||||||
console.log(dataRload)
|
console.log(dataRload)
|
||||||
//执行重载
|
//执行重载
|
||||||
table.reload('article', {
|
table.reload('article', {
|
||||||
page: {
|
page: {
|
||||||
curr: 1 //重新从第 1 页开始
|
curr: 1 //重新从第 1 页开始
|
||||||
}
|
}
|
||||||
,where: {
|
,where: {
|
||||||
...dataRload
|
...dataRload
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//商户商品分类菜单
|
//商户商品分类菜单
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/store/category/select',
|
url: '/admin/store/category/select',
|
||||||
method: "get",
|
method: "get",
|
||||||
data: {},
|
data: {},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.code!==0)return ;
|
if (res.code!==0)return ;
|
||||||
|
|
||||||
//高级演示 - 各种组合
|
//高级演示 - 各种组合
|
||||||
dropdown.render({
|
dropdown.render({
|
||||||
elem: '#seleform'
|
elem: '#seleform'
|
||||||
,isAllowSpread: false //禁止菜单组展开收缩
|
,isAllowSpread: false //禁止菜单组展开收缩
|
||||||
,style: 'width: 200px' //定义宽度,默认自适应
|
,style: 'width: 200px' //定义宽度,默认自适应
|
||||||
,id: 'test777' //定义唯一索引
|
,id: 'test777' //定义唯一索引
|
||||||
,title: 'title1'
|
,title: 'title1'
|
||||||
,data: res.data
|
,data: res.data
|
||||||
,click: function(item){
|
,click: function(item){
|
||||||
$('#seleform').text(item.title);
|
$('#seleform').text(item.title);
|
||||||
$('#seleform').css({color:'rgba(0,0,0,.85)'});
|
$('#seleform').css({color:'rgba(0,0,0,.85)'});
|
||||||
$('#store_cate').val(item.id);
|
$('#store_cate').val(item.id);
|
||||||
|
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
active['reload'] ? active['reload'].call(this) : '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail:function(){}
|
fail:function(){}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//基础效果
|
//基础效果
|
||||||
rate.render({
|
rate.render({
|
||||||
elem: '#is_good'
|
elem: '#is_good'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//监听搜索提交
|
//监听搜索提交
|
||||||
form.on('submit(searchform)', function(data) {
|
form.on('submit(searchform)', function(data) {
|
||||||
layui.pageTable.reload({
|
layui.pageTable.reload({
|
||||||
where: {
|
where: {
|
||||||
...data.field
|
...data.field
|
||||||
},
|
},
|
||||||
page: {
|
page: {
|
||||||
curr: 1
|
curr: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
//监听select提交
|
//监听select提交
|
||||||
form.on('select(seleform)', function(data) {
|
form.on('select(seleform)', function(data) {
|
||||||
active['reload'] ? active['reload'].call(this) : '';
|
active['reload'] ? active['reload'].call(this) : '';
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// 获取表单所有参数
|
// 获取表单所有参数
|
||||||
function getformdata() {
|
function getformdata() {
|
||||||
var form = $('#filterform').serializeArray();
|
var form = $('#filterform').serializeArray();
|
||||||
|
|
||||||
var data = new Array();
|
var data = new Array();
|
||||||
for(let i=0;i<form.length; i++){
|
for(let i=0;i<form.length; i++){
|
||||||
data[form[i].name] = form[i].value;
|
data[form[i].name] = form[i].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
<!-- /脚本 -->
|
<!-- /脚本 -->
|
@ -83,63 +83,6 @@ abstract class BaseController
|
|||||||
//每页显示数据量
|
//每页显示数据量
|
||||||
$this->pageSize = Request::param('page_size', \think\facade\Config::get('app.page_size'));
|
$this->pageSize = Request::param('page_size', \think\facade\Config::get('app.page_size'));
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
// 暂时去除 -----------------------------------------------------
|
|
||||||
// $token = Request::header('x-Token');
|
|
||||||
// if ($token) {
|
|
||||||
// if (strpos($token, 'Bearer') === 0){
|
|
||||||
// $token = trim(substr($token, 6));
|
|
||||||
// }
|
|
||||||
// if (count(explode('.', $token)) != 3) {
|
|
||||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
|
||||||
// }
|
|
||||||
// $config = get_system_config('token');
|
|
||||||
|
|
||||||
// return json($token);
|
|
||||||
// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
|
||||||
// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
|
|
||||||
|
|
||||||
// return $decoded->jti[0];
|
|
||||||
// exit;
|
|
||||||
// //var_dump($config);exit;
|
|
||||||
// try {
|
|
||||||
// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
|
||||||
// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
|
|
||||||
|
|
||||||
// //return (array)$decoded;
|
|
||||||
// // $decoded_array = json_decode(json_encode($decoded),TRUE);
|
|
||||||
// // $jwt_data = $decoded_array['data'];
|
|
||||||
|
|
||||||
// $user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
|
|
||||||
// if (!$user){
|
|
||||||
// return json(['code'=>403,'msg'=>'签名错误']);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// $user = Db::table('fa_user')->where('id',$user['n_user_id'])->find();
|
|
||||||
// //$request->uid = $jwt_data['userid'];
|
|
||||||
// define('$this->request->uid', $user['id']);
|
|
||||||
// // $response = $next($request);
|
|
||||||
// // return $response;
|
|
||||||
// //return $next($request);
|
|
||||||
// } catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
|
|
||||||
// return json(['code'=>403,'msg'=>'签名错误']);
|
|
||||||
// }catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
|
|
||||||
// return json(['code'=>401,'msg'=>'token失效']);
|
|
||||||
// }catch(\Firebase\JWT\ExpiredException $e) { // token过期
|
|
||||||
// return json(['code'=>401,'msg'=>'token已过期']);
|
|
||||||
// }catch(Exception $e) { //其他错误
|
|
||||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
|
||||||
// }catch(\UnexpectedValueException $e) { //其他错误
|
|
||||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
|
||||||
// } catch(\DomainException $e) { //其他错误
|
|
||||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
|
||||||
// }
|
|
||||||
// }else{
|
|
||||||
// define('$this->request->uid', '');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 暂时去除 -----------------------------------------------------
|
|
||||||
=======
|
|
||||||
$token = Request::header('x-Token');
|
$token = Request::header('x-Token');
|
||||||
if ($token) {
|
if ($token) {
|
||||||
if (strpos($token, 'Bearer') === 0){
|
if (strpos($token, 'Bearer') === 0){
|
||||||
@ -190,7 +133,46 @@ abstract class BaseController
|
|||||||
return json(['code'=>404,'msg'=>'token不能为空']);
|
return json(['code'=>404,'msg'=>'token不能为空']);
|
||||||
}
|
}
|
||||||
|
|
||||||
>>>>>>> 更新接口验证方式,统一改为:$this->request->参数
|
// return $decoded->jti[0];
|
||||||
|
// exit;
|
||||||
|
// //var_dump($config);exit;
|
||||||
|
// try {
|
||||||
|
// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
||||||
|
// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
|
||||||
|
|
||||||
|
// //return (array)$decoded;
|
||||||
|
// // $decoded_array = json_decode(json_encode($decoded),TRUE);
|
||||||
|
// // $jwt_data = $decoded_array['data'];
|
||||||
|
|
||||||
|
// $user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
|
||||||
|
// if (!$user){
|
||||||
|
// return json(['code'=>403,'msg'=>'签名错误']);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// $user = Db::table('fa_user')->where('id',$user['n_user_id'])->find();
|
||||||
|
// //$request->uid = $jwt_data['userid'];
|
||||||
|
// define('$this->request->uid', $user['id']);
|
||||||
|
// // $response = $next($request);
|
||||||
|
// // return $response;
|
||||||
|
// //return $next($request);
|
||||||
|
// } catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
|
||||||
|
// return json(['code'=>403,'msg'=>'签名错误']);
|
||||||
|
// }catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
|
||||||
|
// return json(['code'=>401,'msg'=>'token失效']);
|
||||||
|
// }catch(\Firebase\JWT\ExpiredException $e) { // token过期
|
||||||
|
// return json(['code'=>401,'msg'=>'token已过期']);
|
||||||
|
// }catch(Exception $e) { //其他错误
|
||||||
|
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||||
|
// }catch(\UnexpectedValueException $e) { //其他错误
|
||||||
|
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||||
|
// } catch(\DomainException $e) { //其他错误
|
||||||
|
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// define('$this->request->uid', '');
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 暂时去除 -----------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -245,3 +227,4 @@ abstract class BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 这是系统自动生成的middleware定义文件
|
// 这是系统自动生成的middleware定义文件
|
||||||
return [
|
return [
|
||||||
@ -6,9 +7,4 @@ return [
|
|||||||
//验证勾股cms是否完成安装
|
//验证勾股cms是否完成安装
|
||||||
\app\home\middleware\Install::class,
|
\app\home\middleware\Install::class,
|
||||||
\app\api\middleware\AllowOriginMiddleware::class,
|
\app\api\middleware\AllowOriginMiddleware::class,
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
// \app\api\middleware\Auth::class,
|
|
||||||
>>>>>>> 更新接口验证方式,统一改为:$this->request->参数
|
|
||||||
];
|
];
|
File diff suppressed because it is too large
Load Diff
@ -1,126 +1,126 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\common\model\merchant\store;
|
namespace app\common\model\merchant\store;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
|
|
||||||
class ShippingTemplate extends Model
|
class ShippingTemplate extends Model
|
||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
protected $table = 'eb_shipping_template';
|
protected $table = 'eb_shipping_template';
|
||||||
protected $pk = 'shipping_template_id';
|
protected $pk = 'shipping_template_id';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $merId
|
* @param int $merId
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
*/
|
*/
|
||||||
public function createDefault(int $merId)
|
public function createDefault(int $merId)
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
"name" => "默认模板",
|
"name" => "默认模板",
|
||||||
"type" => 1,
|
"type" => 1,
|
||||||
"appoint" => 0,
|
"appoint" => 0,
|
||||||
"undelivery" => 0,
|
"undelivery" => 0,
|
||||||
'mer_id' => $merId,
|
'mer_id' => $merId,
|
||||||
"region" => [[
|
"region" => [[
|
||||||
"first" => 0,
|
"first" => 0,
|
||||||
"first_price" => 0,
|
"first_price" => 0,
|
||||||
"continue" => 0,
|
"continue" => 0,
|
||||||
"continue_price" => 0,
|
"continue_price" => 0,
|
||||||
"city_id" => 0
|
"city_id" => 0
|
||||||
]]
|
]]
|
||||||
];
|
];
|
||||||
return $this->createTemp($data);
|
return $this->createTemp($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:Qinii
|
* @Author:Qinii
|
||||||
* @Date: 2020/5/13
|
* @Date: 2020/5/13
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*/
|
*/
|
||||||
public function createTemp(array $data)
|
public function createTemp(array $data)
|
||||||
{
|
{
|
||||||
Db::transaction(function()use ($data) {
|
Db::transaction(function()use ($data) {
|
||||||
$region = $data['region'];
|
$region = $data['region'];
|
||||||
$free = $data['free'] ?? '';
|
$free = $data['free'] ?? '';
|
||||||
$undelives = $data['undelives'] ?? '';
|
$undelives = $data['undelives'] ?? '';
|
||||||
unset($data['region'],$data['free'],$data['undelives'],$data['city_ids']);
|
unset($data['region'],$data['free'],$data['undelives'],$data['city_ids']);
|
||||||
$temp = self::create($data);
|
$temp = self::create($data);
|
||||||
if($data['appoint']) {
|
if($data['appoint']) {
|
||||||
$settlefree = $this->settleFree($free, $temp['shipping_template_id']);
|
$settlefree = $this->settleFree($free, $temp['shipping_template_id']);
|
||||||
|
|
||||||
(app()->make(ShippingTemplateFree::class))->addData($settlefree);
|
(app()->make(ShippingTemplateFree::class))->addData($settlefree);
|
||||||
}
|
}
|
||||||
|
|
||||||
$settleRegion = $this->settleRegion($region, $temp['shipping_template_id']);
|
$settleRegion = $this->settleRegion($region, $temp['shipping_template_id']);
|
||||||
(app()->make(ShippingTemplateRegion::class))->addData($settleRegion);
|
(app()->make(ShippingTemplateRegion::class))->addData($settleRegion);
|
||||||
|
|
||||||
if($data['undelivery'] == 1){
|
if($data['undelivery'] == 1){
|
||||||
|
|
||||||
$settleUndelives = $this->settleUndelives($undelives,$temp['shipping_template_id']);
|
$settleUndelives = $this->settleUndelives($undelives,$temp['shipping_template_id']);
|
||||||
|
|
||||||
(app()->make(ShippingTemplateUndelive::class))->create($settleUndelives);
|
(app()->make(ShippingTemplateUndelive::class))->create($settleUndelives);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $data
|
* @param $data
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return array
|
* @return array
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
*/
|
*/
|
||||||
public function settleFree($data,$id)
|
public function settleFree($data,$id)
|
||||||
{
|
{
|
||||||
foreach ($data as $v){
|
foreach ($data as $v){
|
||||||
if (isset($v['city_id']) && !is_array($v['city_id'])) throw new ValidateException('包邮参数类型错误');
|
if (isset($v['city_id']) && !is_array($v['city_id'])) throw new ValidateException('包邮参数类型错误');
|
||||||
$city = '/'.implode('/',$v['city_id']).'/';
|
$city = '/'.implode('/',$v['city_id']).'/';
|
||||||
$free[] = [
|
$free[] = [
|
||||||
'temp_id' => $id,
|
'temp_id' => $id,
|
||||||
'city_id' => $city,
|
'city_id' => $city,
|
||||||
'number' => $v['number'],
|
'number' => $v['number'],
|
||||||
'price' => $v['price']
|
'price' => $v['price']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return $free;
|
return $free;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:Qinii
|
* @Author:Qinii
|
||||||
* @Date: 2020/5/13
|
* @Date: 2020/5/13
|
||||||
* @param $data
|
* @param $data
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function settleRegion($data,$id)
|
public function settleRegion($data,$id)
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($data as $k => $v){
|
foreach ($data as $k => $v){
|
||||||
$result[] = [
|
$result[] = [
|
||||||
'city_id' => ($k > 0 ) ? '/'.implode('/',$v['city_id']).'/' : 0,
|
'city_id' => ($k > 0 ) ? '/'.implode('/',$v['city_id']).'/' : 0,
|
||||||
'temp_id' => $id,
|
'temp_id' => $id,
|
||||||
'first' => $v['first'],
|
'first' => $v['first'],
|
||||||
'first_price'=> $v['first_price'],
|
'first_price'=> $v['first_price'],
|
||||||
'continue' => $v['continue'],
|
'continue' => $v['continue'],
|
||||||
'continue_price'=> $v['continue_price'],
|
'continue_price'=> $v['continue_price'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $data
|
* @param $data
|
||||||
* @param $id
|
* @param $id
|
||||||
* @return array
|
* @return array
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
*/
|
*/
|
||||||
public function settleUndelives($data,$id)
|
public function settleUndelives($data,$id)
|
||||||
{
|
{
|
||||||
if (isset($v['city_id']) && !is_array($data['city_id'])) throw new ValidateException('指定不配送参数类型错误');
|
if (isset($v['city_id']) && !is_array($data['city_id'])) throw new ValidateException('指定不配送参数类型错误');
|
||||||
|
|
||||||
return ['temp_id' => $id, 'city_id' => $data['city_id']];
|
return ['temp_id' => $id, 'city_id' => $data['city_id']];
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,24 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\common\model\merchant\store;
|
namespace app\common\model\merchant\store;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
|
||||||
class ShippingTemplateFree extends Model
|
class ShippingTemplateFree extends Model
|
||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
protected $table = 'eb_shipping_template_free';
|
protected $table = 'eb_shipping_template_free';
|
||||||
protected $pk = 'shipping_template_free_id';
|
protected $pk = 'shipping_template_free_id';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:Qinii
|
* @Author:Qinii
|
||||||
* @Date: 2020/5/13
|
* @Date: 2020/5/13
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function addData(array $data)
|
public function addData(array $data)
|
||||||
{
|
{
|
||||||
return self::insertAll($data);
|
return self::insertAll($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,395 +1,395 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @date :2023年03月9日
|
* @date :2023年03月9日
|
||||||
* @author:刘孝全
|
* @author:刘孝全
|
||||||
* @email:q8197264@126.com
|
* @email:q8197264@126.com
|
||||||
*
|
*
|
||||||
* @ 商品参数关联表
|
* @ 商品参数关联表
|
||||||
*/
|
*/
|
||||||
namespace app\common\model\merchant\system;
|
namespace app\common\model\merchant\system;
|
||||||
|
|
||||||
use app\common\model\merchant\store\product\Spu;
|
use app\common\model\merchant\store\product\Spu;
|
||||||
use app\common\model\merchant\community\Community;
|
use app\common\model\merchant\community\Community;
|
||||||
use app\common\model\merchant\store\StoreCategory;
|
use app\common\model\merchant\store\StoreCategory;
|
||||||
use app\common\model\merchant\system\auth\Menu;
|
use app\common\model\merchant\system\auth\Menu;
|
||||||
use app\common\model\merchant\system\merchant\Merchant;
|
use app\common\model\merchant\system\merchant\Merchant;
|
||||||
use app\common\model\merchant\user\User;
|
use app\common\model\merchant\user\User;
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use think\exception\ValidateException;
|
use think\exception\ValidateException;
|
||||||
|
|
||||||
class Relevance extends Model
|
class Relevance extends Model
|
||||||
{
|
{
|
||||||
protected $connection = 'shop';
|
protected $connection = 'shop';
|
||||||
protected $table = 'eb_relevance';
|
protected $table = 'eb_relevance';
|
||||||
protected $pk = 'relevance_id';
|
protected $pk = 'relevance_id';
|
||||||
|
|
||||||
//文章关联商品
|
//文章关联商品
|
||||||
const TYPE_COMMUNITY_PRODUCT = 'community_product';
|
const TYPE_COMMUNITY_PRODUCT = 'community_product';
|
||||||
//社区关注
|
//社区关注
|
||||||
const TYPE_COMMUNITY_FANS = 'fans';
|
const TYPE_COMMUNITY_FANS = 'fans';
|
||||||
//社区文章点赞
|
//社区文章点赞
|
||||||
const TYPE_COMMUNITY_START = 'community_start';
|
const TYPE_COMMUNITY_START = 'community_start';
|
||||||
//社区评论点赞
|
//社区评论点赞
|
||||||
const TYPE_COMMUNITY_REPLY_START = 'community_reply_start';
|
const TYPE_COMMUNITY_REPLY_START = 'community_reply_start';
|
||||||
//商户权限
|
//商户权限
|
||||||
const TYPE_MERCHANT_AUTH = 'mer_auth';
|
const TYPE_MERCHANT_AUTH = 'mer_auth';
|
||||||
|
|
||||||
//指定范围类型
|
//指定范围类型
|
||||||
//0全部商品
|
//0全部商品
|
||||||
const TYPE_ALL = 'scope_type';
|
const TYPE_ALL = 'scope_type';
|
||||||
//指定商品
|
//指定商品
|
||||||
const SCOPE_TYPE_PRODUCT = 'scope_type_product';
|
const SCOPE_TYPE_PRODUCT = 'scope_type_product';
|
||||||
//指定分类
|
//指定分类
|
||||||
const SCOPE_TYPE_CATEGORY = 'scope_type_category';
|
const SCOPE_TYPE_CATEGORY = 'scope_type_category';
|
||||||
//指定商户
|
//指定商户
|
||||||
const SCOPE_TYPE_STORE = 'scope_type_store';
|
const SCOPE_TYPE_STORE = 'scope_type_store';
|
||||||
//价格说明关联分类
|
//价格说明关联分类
|
||||||
const PRICE_RULE_CATEGORY = 'price_rule_category';
|
const PRICE_RULE_CATEGORY = 'price_rule_category';
|
||||||
|
|
||||||
//商品参数关联
|
//商品参数关联
|
||||||
const PRODUCT_PARAMES_CATE = 'product_params_cate';
|
const PRODUCT_PARAMES_CATE = 'product_params_cate';
|
||||||
|
|
||||||
|
|
||||||
public function fans()
|
public function fans()
|
||||||
{
|
{
|
||||||
return $this->hasOne(User::class,'uid','left_id');
|
return $this->hasOne(User::class,'uid','left_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function focus()
|
public function focus()
|
||||||
{
|
{
|
||||||
return $this->hasOne(User::class,'uid','right_id');
|
return $this->hasOne(User::class,'uid','right_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function community()
|
public function community()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Community::class,'community_id','right_id')
|
return $this->hasOne(Community::class,'community_id','right_id')
|
||||||
->bind(['community_id','title','image','start','uid','create_time','count_start','author','is_type']);
|
->bind(['community_id','title','image','start','uid','create_time','count_start','author','is_type']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsStartAttr()
|
public function getIsStartAttr()
|
||||||
{
|
{
|
||||||
return self::where('left_id', $this->right_id)
|
return self::where('left_id', $this->right_id)
|
||||||
->where('right_id',$this->left_id)
|
->where('right_id',$this->left_id)
|
||||||
->where('type', 'fans')
|
->where('type', 'fans')
|
||||||
->count() > 0;
|
->count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function spu()
|
public function spu()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Spu::class, 'spu_id','right_id');
|
return $this->hasOne(Spu::class, 'spu_id','right_id');
|
||||||
}
|
}
|
||||||
public function merchant()
|
public function merchant()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Merchant::class, 'mer_id','right_id');
|
return $this->hasOne(Merchant::class, 'mer_id','right_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function category()
|
public function category()
|
||||||
{
|
{
|
||||||
return $this->hasOne(StoreCategory::class, 'store_category_id','right_id');
|
return $this->hasOne(StoreCategory::class, 'store_category_id','right_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function auth()
|
public function auth()
|
||||||
{
|
{
|
||||||
return $this->hasOne(Menu::class, 'menu_id','right_id');
|
return $this->hasOne(Menu::class, 'menu_id','right_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchLeftIdAttr($query, $value)
|
public function searchLeftIdAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('left_id', $value);
|
$query->where('left_id', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchRightIdAttr($query, $value)
|
public function searchRightIdAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('right_id', $value);
|
$query->where('right_id', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchTypeAttr($query, $value)
|
public function searchTypeAttr($query, $value)
|
||||||
{
|
{
|
||||||
$query->where('type', $value);
|
$query->where('type', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function getInstance(): self
|
public static function getInstance(): self
|
||||||
{
|
{
|
||||||
return new static();
|
return new static();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 搜索
|
* TODO 搜索
|
||||||
* @param $where
|
* @param $where
|
||||||
* @return BaseModel
|
* @return BaseModel
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 2020-10-16
|
* @day 2020-10-16
|
||||||
*/
|
*/
|
||||||
protected function getSearch(array $where)
|
protected function getSearch(array $where)
|
||||||
{
|
{
|
||||||
foreach ($where as $key => $item) {
|
foreach ($where as $key => $item) {
|
||||||
if ($item !== '') {
|
if ($item !== '') {
|
||||||
$keyArray[] = $key;
|
$keyArray[] = $key;
|
||||||
$whereArr[$key] = $item;
|
$whereArr[$key] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(empty($keyArray)){
|
if(empty($keyArray)){
|
||||||
return self::getInstance()->db();
|
return self::getInstance()->db();
|
||||||
}else{
|
}else{
|
||||||
return self::withSearch($keyArray, $whereArr);
|
return self::withSearch($keyArray, $whereArr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 添加
|
* TODO 添加
|
||||||
* @param int $leftId
|
* @param int $leftId
|
||||||
* @param int $rightId
|
* @param int $rightId
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @param $check
|
* @param $check
|
||||||
* @return bool
|
* @return bool
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function insert(int $leftId, int $rightId, string $type, bool $check = false)
|
public function insert(int $leftId, int $rightId, string $type, bool $check = false)
|
||||||
{
|
{
|
||||||
if ($check && $this->checkHas($leftId, $rightId, $type)) {
|
if ($check && $this->checkHas($leftId, $rightId, $type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'left_id' => $leftId,
|
'left_id' => $leftId,
|
||||||
'right_id'=> $rightId,
|
'right_id'=> $rightId,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
];
|
];
|
||||||
|
|
||||||
try{
|
try{
|
||||||
Relevance::create($data);
|
Relevance::create($data);
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
throw new ValidateException('创建失败');
|
throw new ValidateException('创建失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 删除
|
* TODO 删除
|
||||||
* @param int $leftId
|
* @param int $leftId
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @param int $rightId
|
* @param int $rightId
|
||||||
* @return bool
|
* @return bool
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function destory(int $leftId, int $rightId, string $type)
|
public function destory(int $leftId, int $rightId, string $type)
|
||||||
{
|
{
|
||||||
return $this->getSearch([
|
return $this->getSearch([
|
||||||
'left_id' => $leftId,
|
'left_id' => $leftId,
|
||||||
'right_id'=> $rightId,
|
'right_id'=> $rightId,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
])->delete();
|
])->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 检测是否存在
|
* TODO 检测是否存在
|
||||||
* @param int $leftId
|
* @param int $leftId
|
||||||
* @param int $rightId
|
* @param int $rightId
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @return int
|
* @return int
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function checkHas(int $leftId, int $rightId, string $type)
|
public function checkHas(int $leftId, int $rightId, string $type)
|
||||||
{
|
{
|
||||||
return $this->getSearch([
|
return $this->getSearch([
|
||||||
'left_id' => $leftId,
|
'left_id' => $leftId,
|
||||||
'right_id'=> $rightId,
|
'right_id'=> $rightId,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
])->count();
|
])->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 根据左键批量删除
|
* TODO 根据左键批量删除
|
||||||
* @param int $leftId
|
* @param int $leftId
|
||||||
* @param $type
|
* @param $type
|
||||||
* @return bool
|
* @return bool
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function batchDelete(int $leftId, $type)
|
public function batchDelete(int $leftId, $type)
|
||||||
{
|
{
|
||||||
return $this->getSearch([
|
return $this->getSearch([
|
||||||
'left_id' => $leftId,
|
'left_id' => $leftId,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
])->delete();
|
])->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 关注我的人
|
* TODO 关注我的人
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @return \think\Collection
|
* @return \think\Collection
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function getUserFans(int $uid, int $page, int $limit)
|
public function getUserFans(int $uid, int $page, int $limit)
|
||||||
{
|
{
|
||||||
$query = $this->getSearch([
|
$query = $this->getSearch([
|
||||||
'right_id' => $uid,
|
'right_id' => $uid,
|
||||||
'type' => self::TYPE_COMMUNITY_FANS,
|
'type' => self::TYPE_COMMUNITY_FANS,
|
||||||
])->with([
|
])->with([
|
||||||
'fans' => function($query) {
|
'fans' => function($query) {
|
||||||
$query->field('uid,avatar,nickname,count_fans');
|
$query->field('uid,avatar,nickname,count_fans');
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
$count = $query->count();
|
$count = $query->count();
|
||||||
$list = $query->page($page, $limit)->select()->append(['is_start']);
|
$list = $query->page($page, $limit)->select()->append(['is_start']);
|
||||||
return compact('count','list');
|
return compact('count','list');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 我关注的人
|
* TODO 我关注的人
|
||||||
* @param $uid
|
* @param $uid
|
||||||
* @return \think\Collection
|
* @return \think\Collection
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function getUserFocus(int $uid, int $page, int $limit)
|
public function getUserFocus(int $uid, int $page, int $limit)
|
||||||
{
|
{
|
||||||
$query = $this->getSearch([
|
$query = $this->getSearch([
|
||||||
'left_id' => $uid,
|
'left_id' => $uid,
|
||||||
'type' => self::TYPE_COMMUNITY_FANS,
|
'type' => self::TYPE_COMMUNITY_FANS,
|
||||||
])->with([
|
])->with([
|
||||||
'focus' => function($query) {
|
'focus' => function($query) {
|
||||||
$query->field('uid,avatar,nickname,count_fans');
|
$query->field('uid,avatar,nickname,count_fans');
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
$count = $query->count();
|
$count = $query->count();
|
||||||
$list = $query->page($page, $limit)->select()->append(['is_fans']);
|
$list = $query->page($page, $limit)->select()->append(['is_fans']);
|
||||||
return compact('count','list');
|
return compact('count','list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 我点赞过的文章
|
* TODO 我点赞过的文章
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @return \think\Collection
|
* @return \think\Collection
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function getUserStartCommunity(array $where, int $page, int $limit)
|
public function getUserStartCommunity(array $where, int $page, int $limit)
|
||||||
{
|
{
|
||||||
$query = $this->joinUser($where)->with([
|
$query = $this->joinUser($where)->with([
|
||||||
'community'=> function($query) use($where){
|
'community'=> function($query) use($where){
|
||||||
$query->with([
|
$query->with([
|
||||||
'author' => function($query){
|
'author' => function($query){
|
||||||
$query->field('uid,real_name,status,avatar,nickname,count_start');
|
$query->field('uid,real_name,status,avatar,nickname,count_start');
|
||||||
},
|
},
|
||||||
'is_start' => function($query) use ($where) {
|
'is_start' => function($query) use ($where) {
|
||||||
$query->where('left_id',$where['uid']);
|
$query->where('left_id',$where['uid']);
|
||||||
},
|
},
|
||||||
'topic' => function($query) {
|
'topic' => function($query) {
|
||||||
$query->where('status', 1)->where('is_del',0);
|
$query->where('status', 1)->where('is_del',0);
|
||||||
$query->field('topic_id,topic_name,status,category_id,pic,is_del');
|
$query->field('topic_id,topic_name,status,category_id,pic,is_del');
|
||||||
},
|
},
|
||||||
'relevance' => [
|
'relevance' => [
|
||||||
'spu' => function($query) {
|
'spu' => function($query) {
|
||||||
$query->field('spu_id,store_name,image,price,product_type,activity_id,product_id');
|
$query->field('spu_id,store_name,image,price,product_type,activity_id,product_id');
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'is_fans' => function($query) use($where){
|
'is_fans' => function($query) use($where){
|
||||||
$query->where('left_id',$where['uid']);
|
$query->where('left_id',$where['uid']);
|
||||||
}]);
|
}]);
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
$count = $query->count();
|
$count = $query->count();
|
||||||
$list = $query->page($page, $limit)->select()->each(function ($item){
|
$list = $query->page($page, $limit)->select()->each(function ($item){
|
||||||
$item['time'] = date('m月d日', strtotime($item['create_time']));
|
$item['time'] = date('m月d日', strtotime($item['create_time']));
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
|
|
||||||
return compact('count','list');
|
return compact('count','list');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 我点赞过的文章
|
* TODO 我点赞过的文章
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @return \think\Collection
|
* @return \think\Collection
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 10/28/21
|
* @day 10/28/21
|
||||||
*/
|
*/
|
||||||
public function getUserStartCommunityByVideos(array $where, int $page, int $limit)
|
public function getUserStartCommunityByVideos(array $where, int $page, int $limit)
|
||||||
{
|
{
|
||||||
$query = $this->joinUser($where)->with([
|
$query = $this->joinUser($where)->with([
|
||||||
'community'=> function($query) {
|
'community'=> function($query) {
|
||||||
$query->with(['author'=> function($query) {
|
$query->with(['author'=> function($query) {
|
||||||
$query->field('uid,avatar,nickname');
|
$query->field('uid,avatar,nickname');
|
||||||
}]);
|
}]);
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
$count = $query->count();
|
$count = $query->count();
|
||||||
$list = $query->page($page, $limit)->select()->each(function ($item){
|
$list = $query->page($page, $limit)->select()->each(function ($item){
|
||||||
$item['time'] = date('m月d日', strtotime($item['create_time']));
|
$item['time'] = date('m月d日', strtotime($item['create_time']));
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
|
|
||||||
return compact('count','list');
|
return compact('count','list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFieldCount(string $field, int $value, string $type)
|
public function getFieldCount(string $field, int $value, string $type)
|
||||||
{
|
{
|
||||||
return $this->getSearch([$field => $value, 'type' => $type,])->count();
|
return $this->getSearch([$field => $value, 'type' => $type,])->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function createMany(int $leftId, array $rightId, string $type)
|
public function createMany(int $leftId, array $rightId, string $type)
|
||||||
{
|
{
|
||||||
if (!empty($rightId)) {
|
if (!empty($rightId)) {
|
||||||
foreach ($rightId as $value) {
|
foreach ($rightId as $value) {
|
||||||
$res[] = [
|
$res[] = [
|
||||||
'left_id' => $leftId,
|
'left_id' => $leftId,
|
||||||
'right_id' => $value,
|
'right_id' => $value,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
self::batchInsert($res);
|
self::batchInsert($res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量插入
|
* 批量插入
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @return int
|
* @return int
|
||||||
* @author xaboy
|
* @author xaboy
|
||||||
* @day 2020/6/8
|
* @day 2020/6/8
|
||||||
*/
|
*/
|
||||||
public function batchInsert(array $data)
|
public function batchInsert(array $data)
|
||||||
{
|
{
|
||||||
$rows = Relevance::insertAll($data);
|
$rows = Relevance::insertAll($data);
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------- 2 ---------------
|
// ------- 2 ---------------
|
||||||
public function clear(int $id, $type, string $field)
|
public function clear(int $id, $type, string $field)
|
||||||
{
|
{
|
||||||
if (is_string($type)) $type = [$type];
|
if (is_string($type)) $type = [$type];
|
||||||
return Relevance::where($field, $id)->whereIn('type', $type)->delete();
|
return Relevance::where($field, $id)->whereIn('type', $type)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function joinUser($where)
|
public function joinUser($where)
|
||||||
{
|
{
|
||||||
$query = Relevance::hasWhere('community',function($query) use($where){
|
$query = Relevance::hasWhere('community',function($query) use($where){
|
||||||
$query->where('status',1)->where('is_show',1)->where('is_del',0);
|
$query->where('status',1)->where('is_show',1)->where('is_del',0);
|
||||||
$query->when(isset($where['is_type']) && $where['is_type'] !== '',function($query) use($where){
|
$query->when(isset($where['is_type']) && $where['is_type'] !== '',function($query) use($where){
|
||||||
$query->where('is_type',$where['is_type']);
|
$query->where('is_type',$where['is_type']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$query->where('left_id',$where['uid'])->where('type',self::TYPE_COMMUNITY_START);
|
$query->where('left_id',$where['uid'])->where('type',self::TYPE_COMMUNITY_START);
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
//--------------------------
|
//--------------------------
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,294 +1,294 @@
|
|||||||
<?php
|
<?php
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
namespace app\validate\merchant\admin;
|
namespace app\validate\merchant\admin;
|
||||||
|
|
||||||
|
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
class MerchantApplymentsValidate extends Validate
|
class MerchantApplymentsValidate extends Validate
|
||||||
{
|
{
|
||||||
protected $failException = true;
|
protected $failException = true;
|
||||||
|
|
||||||
//2401:小微商户,指无营业执照的个人商家。
|
//2401:小微商户,指无营业执照的个人商家。
|
||||||
//2500:个人卖家,指无营业执照,已持续从事电子商务经营活动满6个月,且期间经营收入累计超过20万元的个人商家。(若选择该主体,请在“补充说明”填写相关描述)
|
//2500:个人卖家,指无营业执照,已持续从事电子商务经营活动满6个月,且期间经营收入累计超过20万元的个人商家。(若选择该主体,请在“补充说明”填写相关描述)
|
||||||
//4:个体工商户,营业执照上的主体类型一般为个体户、个体工商户、个体经营。
|
//4:个体工商户,营业执照上的主体类型一般为个体户、个体工商户、个体经营。
|
||||||
//2:企业,营业执照上的主体类型一般为有限公司、有限责任公司。
|
//2:企业,营业执照上的主体类型一般为有限公司、有限责任公司。
|
||||||
//3:党政、机关及事业单位,包括国内各级、各类政府机构、事业单位等(如:公安、党 团、司法、交通、旅游、工商税务、市政、医疗、教育、学校等机构)。
|
//3:党政、机关及事业单位,包括国内各级、各类政府机构、事业单位等(如:公安、党 团、司法、交通、旅游、工商税务、市政、医疗、教育、学校等机构)。
|
||||||
//1708:其他组织,不属于企业、政府/事业单位的组织机构(如社会团体、民办非企业、基 金会),要求机构已办理组织机构代码证。
|
//1708:其他组织,不属于企业、政府/事业单位的组织机构(如社会团体、民办非企业、基 金会),要求机构已办理组织机构代码证。
|
||||||
|
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'organization_type|主体类型' => 'require|in:2,3,4,2401,2500,1708',
|
'organization_type|主体类型' => 'require|in:2,3,4,2401,2500,1708',
|
||||||
'business_license_info|营业执照/登记证书信息' => 'checkBusinessInfo',
|
'business_license_info|营业执照/登记证书信息' => 'checkBusinessInfo',
|
||||||
// 'organization_cert_info|组织机构代码证信息' => 'checkOrganization',
|
// 'organization_cert_info|组织机构代码证信息' => 'checkOrganization',
|
||||||
'id_doc_type|证件类型' => 'require|in:1,2,3,4,5,6,7,8',
|
'id_doc_type|证件类型' => 'require|in:1,2,3,4,5,6,7,8',
|
||||||
'id_card_info|经营者/法人身份证信息' => 'checkIdCardInfo',
|
'id_card_info|经营者/法人身份证信息' => 'checkIdCardInfo',
|
||||||
'id_doc_info|经营者/法人身份证信息' => 'checkIdDocInfo',
|
'id_doc_info|经营者/法人身份证信息' => 'checkIdDocInfo',
|
||||||
// 'need_account_info|是否填写结算银行账户' => 'require|in:true,false', 废弃字段
|
// 'need_account_info|是否填写结算银行账户' => 'require|in:true,false', 废弃字段
|
||||||
'account_info|结算银行账户' => 'getAccountInfo',
|
'account_info|结算银行账户' => 'getAccountInfo',
|
||||||
'contact_info|超级管理员信息' => 'getContactInfo',
|
'contact_info|超级管理员信息' => 'getContactInfo',
|
||||||
'sales_scene_info|店铺信息'=>'checkSalesSceneInfo',
|
'sales_scene_info|店铺信息'=>'checkSalesSceneInfo',
|
||||||
'merchant_shortname|商户简称' => 'require',
|
'merchant_shortname|商户简称' => 'require',
|
||||||
'business_addition_desc' => 'checkBusinessAdditionDesc',
|
'business_addition_desc' => 'checkBusinessAdditionDesc',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 营业执照/登记证书信息
|
* TODO 营业执照/登记证书信息
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function checkBusinessInfo($item,$rule,$data)
|
protected function checkBusinessInfo($item,$rule,$data)
|
||||||
{
|
{
|
||||||
if(!in_array($data['organization_type'],['2401','2500'])){
|
if(!in_array($data['organization_type'],['2401','2500'])){
|
||||||
if(empty($item)) return '营业执照/登记证书信息为空';
|
if(empty($item)) return '营业执照/登记证书信息为空';
|
||||||
|
|
||||||
if(!isset($item['business_license_copy']) || empty($item['business_license_copy'])) return '证件扫描件为空';
|
if(!isset($item['business_license_copy']) || empty($item['business_license_copy'])) return '证件扫描件为空';
|
||||||
if(!isset($item['business_license_number']) || empty($item['business_license_number'])) return '证件注册号为空';
|
if(!isset($item['business_license_number']) || empty($item['business_license_number'])) return '证件注册号为空';
|
||||||
if(!isset($item['merchant_name']) || empty($item['merchant_name'])) return '商户名称为空';
|
if(!isset($item['merchant_name']) || empty($item['merchant_name'])) return '商户名称为空';
|
||||||
if(!isset($item['legal_person']) || empty($item['legal_person'])) return '经营者/法定代表人姓名为空';
|
if(!isset($item['legal_person']) || empty($item['legal_person'])) return '经营者/法定代表人姓名为空';
|
||||||
|
|
||||||
if(isset($item['business_time'])) {
|
if(isset($item['business_time'])) {
|
||||||
$statr = $item['business_time'][0];
|
$statr = $item['business_time'][0];
|
||||||
$end = $item['business_time'][1];
|
$end = $item['business_time'][1];
|
||||||
if ($end !== '长期') {
|
if ($end !== '长期') {
|
||||||
$statr = strtotime($statr);
|
$statr = strtotime($statr);
|
||||||
$end = strtotime($end);
|
$end = strtotime($end);
|
||||||
$t = $end - $statr;
|
$t = $end - $statr;
|
||||||
if (($t / (3600 * 24)) <= 60) return '营业执照/登记证书有效期必须大于60天,即结束时间距当前时间需超过60天';
|
if (($t / (3600 * 24)) <= 60) return '营业执照/登记证书有效期必须大于60天,即结束时间距当前时间需超过60天';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 组织机构代码证信息
|
* TODO 组织机构代码证信息
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function checkOrganization($item,$rule,$data)
|
protected function checkOrganization($item,$rule,$data)
|
||||||
{
|
{
|
||||||
$len = strlen($data['business_license_info']['business_license_number']);
|
$len = strlen($data['business_license_info']['business_license_number']);
|
||||||
if(!in_array($data['organization_type'],['4','2401','2500']) && $len === 18){
|
if(!in_array($data['organization_type'],['4','2401','2500']) && $len === 18){
|
||||||
if(empty($item)) return '组织机构代码证信息为空';
|
if(empty($item)) return '组织机构代码证信息为空';
|
||||||
|
|
||||||
if(!isset($item['organization_copy']) || empty($item['organization_copy'])) return '组织机构代码证照片为空';
|
if(!isset($item['organization_copy']) || empty($item['organization_copy'])) return '组织机构代码证照片为空';
|
||||||
if(!isset($item['organization_number']) || empty($item['organization_number'])) return '组织机构代码为空';
|
if(!isset($item['organization_number']) || empty($item['organization_number'])) return '组织机构代码为空';
|
||||||
if(!isset($item['organization_time']) || empty($item['organization_time'])) return '组织机构代码有效期限为空';
|
if(!isset($item['organization_time']) || empty($item['organization_time'])) return '组织机构代码有效期限为空';
|
||||||
|
|
||||||
// list($statr,$end) = explode(',',$item['organization_time']);
|
// list($statr,$end) = explode(',',$item['organization_time']);
|
||||||
|
|
||||||
$statr = $item['organization_time'][0];
|
$statr = $item['organization_time'][0];
|
||||||
$end = $item['organization_time'][1];
|
$end = $item['organization_time'][1];
|
||||||
|
|
||||||
if($end !== '长期') {
|
if($end !== '长期') {
|
||||||
$statr = strtotime($statr);
|
$statr = strtotime($statr);
|
||||||
$end = strtotime($end);
|
$end = strtotime($end);
|
||||||
$t = $end - $statr;
|
$t = $end - $statr;
|
||||||
if(($t/(3600 * 24)) <= 60) return '组织机构代码证有效期必须大于60天,即结束时间距当前时间需超过60天';
|
if(($t/(3600 * 24)) <= 60) return '组织机构代码证有效期必须大于60天,即结束时间距当前时间需超过60天';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 经营者/法人身份证信息/身份证
|
* TODO 经营者/法人身份证信息/身份证
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function checkIdCardInfo($item,$rule,$data)
|
protected function checkIdCardInfo($item,$rule,$data)
|
||||||
{
|
{
|
||||||
if($data['id_doc_type'] == 1){
|
if($data['id_doc_type'] == 1){
|
||||||
if(empty($item)) return '经营者/法人身份证信息为空';
|
if(empty($item)) return '经营者/法人身份证信息为空';
|
||||||
|
|
||||||
if(!isset($item['id_card_copy']) || empty($item['id_card_copy'])) return '身份证人像面照片为空';
|
if(!isset($item['id_card_copy']) || empty($item['id_card_copy'])) return '身份证人像面照片为空';
|
||||||
if(!isset($item['id_card_national']) || empty($item['id_card_national'])) return '身份证国徽面照片为空';
|
if(!isset($item['id_card_national']) || empty($item['id_card_national'])) return '身份证国徽面照片为空';
|
||||||
if(!isset($item['id_card_name']) || empty($item['id_card_name'])) return '身份证姓名为空';
|
if(!isset($item['id_card_name']) || empty($item['id_card_name'])) return '身份证姓名为空';
|
||||||
if(!isset($item['id_card_number']) || empty($item['id_card_number'])) return '身份证号码为空';
|
if(!isset($item['id_card_number']) || empty($item['id_card_number'])) return '身份证号码为空';
|
||||||
if(!isset($item['id_card_valid_time_begin']) || empty($item['id_card_valid_time_begin'])) return '经营者/法人身份证信息身份证开始时间为空';
|
if(!isset($item['id_card_valid_time_begin']) || empty($item['id_card_valid_time_begin'])) return '经营者/法人身份证信息身份证开始时间为空';
|
||||||
if(!isset($item['id_card_valid_time']) || empty($item['id_card_valid_time'])) return '经营者/法人身份证信息身份证有效期限为空';
|
if(!isset($item['id_card_valid_time']) || empty($item['id_card_valid_time'])) return '经营者/法人身份证信息身份证有效期限为空';
|
||||||
|
|
||||||
if($item['id_card_valid_time'] !== '长期') {
|
if($item['id_card_valid_time'] !== '长期') {
|
||||||
$statr = time();
|
$statr = time();
|
||||||
$end = strtotime($item['id_card_valid_time']);
|
$end = strtotime($item['id_card_valid_time']);
|
||||||
$t = $end - $statr;
|
$t = $end - $statr;
|
||||||
if(($t/(3600 * 24)) <= 60) return '经营者/法人身份证信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
|
if(($t/(3600 * 24)) <= 60) return '经营者/法人身份证信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
|
||||||
if(strtotime($item['id_card_valid_time_begin']) >= strtotime($item['id_card_valid_time'])) return '经营者/法人身份证信息证件结束日期必须大于证件开始时间';
|
if(strtotime($item['id_card_valid_time_begin']) >= strtotime($item['id_card_valid_time'])) return '经营者/法人身份证信息证件结束日期必须大于证件开始时间';
|
||||||
}
|
}
|
||||||
if($data['organization_type'] === 2){
|
if($data['organization_type'] === 2){
|
||||||
if(!isset($item['id_card_address']) || empty($item['id_card_address'])) return '经营者/法人身份证信息身份证居住地址为空';
|
if(!isset($item['id_card_address']) || empty($item['id_card_address'])) return '经营者/法人身份证信息身份证居住地址为空';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 经营者/法人身份证信息/通行证
|
* TODO 经营者/法人身份证信息/通行证
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function checkIdDocInfo($item,$rule,$data)
|
protected function checkIdDocInfo($item,$rule,$data)
|
||||||
{
|
{
|
||||||
if(in_array($data['organization_type'],['2401','2500']) && !empty($item)) return '小微/个人卖家可选证件类型:身份证';
|
if(in_array($data['organization_type'],['2401','2500']) && !empty($item)) return '小微/个人卖家可选证件类型:身份证';
|
||||||
|
|
||||||
if($data['id_doc_type'] !== 1){
|
if($data['id_doc_type'] !== 1){
|
||||||
if(empty($item)) return '经营者/法人身份证信息为空';
|
if(empty($item)) return '经营者/法人身份证信息为空';
|
||||||
|
|
||||||
if(!isset($item['id_doc_name']) || empty($item['id_doc_name'])) return '证件姓名为空';
|
if(!isset($item['id_doc_name']) || empty($item['id_doc_name'])) return '证件姓名为空';
|
||||||
if(!isset($item['id_doc_number']) || empty($item['id_doc_number'])) return '证件号码为空';
|
if(!isset($item['id_doc_number']) || empty($item['id_doc_number'])) return '证件号码为空';
|
||||||
if(!isset($item['id_doc_copy']) || empty($item['id_doc_copy'])) return '经营者/法人其他类型证件信息证件正面照片为空';
|
if(!isset($item['id_doc_copy']) || empty($item['id_doc_copy'])) return '经营者/法人其他类型证件信息证件正面照片为空';
|
||||||
if($data['id_doc_type'] !== 2) //护照不需要传反面
|
if($data['id_doc_type'] !== 2) //护照不需要传反面
|
||||||
{
|
{
|
||||||
if(!isset($item['id_doc_copy_back']) || empty($item['id_doc_copy_back'])) return '经营者/法人其他类型证件信息证件反面照片为空';
|
if(!isset($item['id_doc_copy_back']) || empty($item['id_doc_copy_back'])) return '经营者/法人其他类型证件信息证件反面照片为空';
|
||||||
}
|
}
|
||||||
if(!isset($item['doc_period_begin']) || empty($item['doc_period_begin'])) return '经营者/法人其他类型证件信息证件有效期开始时间为空';
|
if(!isset($item['doc_period_begin']) || empty($item['doc_period_begin'])) return '经营者/法人其他类型证件信息证件有效期开始时间为空';
|
||||||
if(!isset($item['doc_period_end']) || empty($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期为空';
|
if(!isset($item['doc_period_end']) || empty($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期为空';
|
||||||
|
|
||||||
if($item['doc_period_end'] !== '长期') {
|
if($item['doc_period_end'] !== '长期') {
|
||||||
$statr = time();
|
$statr = time();
|
||||||
$end = strtotime($item['doc_period_end']);
|
$end = strtotime($item['doc_period_end']);
|
||||||
$t = $end - $statr;
|
$t = $end - $statr;
|
||||||
if(($t/(3600 * 24)) <= 60) return '经营者/法人其他类型证件信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
|
if(($t/(3600 * 24)) <= 60) return '经营者/法人其他类型证件信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
|
||||||
if(strtotime($item['doc_period_begin']) >= strtotime($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期必须大于证件开始时间';
|
if(strtotime($item['doc_period_begin']) >= strtotime($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期必须大于证件开始时间';
|
||||||
if($data['organization_type'] === 2){
|
if($data['organization_type'] === 2){
|
||||||
if(!isset($item['id_doc_address']) || empty($item['id_doc_address'])) return '经营者/法人其他类型证件信息证件居住地址为空';
|
if(!isset($item['id_doc_address']) || empty($item['id_doc_address'])) return '经营者/法人其他类型证件信息证件居住地址为空';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 结算银行账户
|
* TODO 结算银行账户
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function getAccountInfo($item,$rule,$data)
|
protected function getAccountInfo($item,$rule,$data)
|
||||||
{
|
{
|
||||||
// if($data['need_account_info']){
|
// if($data['need_account_info']){
|
||||||
|
|
||||||
if(empty($item)) return '结算银行账户信息为空';
|
if(empty($item)) return '结算银行账户信息为空';
|
||||||
|
|
||||||
if(!isset($item['bank_account_type']) || empty($item['bank_account_type'])) return '账户类型为空';
|
if(!isset($item['bank_account_type']) || empty($item['bank_account_type'])) return '账户类型为空';
|
||||||
if(!isset($item['account_bank']) || empty($item['account_bank'])) return '开户银行为空';
|
if(!isset($item['account_bank']) || empty($item['account_bank'])) return '开户银行为空';
|
||||||
if(!isset($item['account_name']) || empty($item['account_name'])) return '开户名称为空';
|
if(!isset($item['account_name']) || empty($item['account_name'])) return '开户名称为空';
|
||||||
if(!isset($item['bank_address_code']) || empty($item['bank_address_code'])) return '开户银行省市编码为空';
|
if(!isset($item['bank_address_code']) || empty($item['bank_address_code'])) return '开户银行省市编码为空';
|
||||||
if(!isset($item['account_number']) || empty($item['account_number'])) return '银行帐号为空';
|
if(!isset($item['account_number']) || empty($item['account_number'])) return '银行帐号为空';
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 超级管理员信息
|
* TODO 超级管理员信息
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function getContactInfo($item,$rule,$data)
|
protected function getContactInfo($item,$rule,$data)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(empty($item)) return '超级管理员信息信息为空';
|
if(empty($item)) return '超级管理员信息信息为空';
|
||||||
|
|
||||||
if(!isset($item['contact_type']) || empty($item['contact_type'])) return '超级管理员类型为空';
|
if(!isset($item['contact_type']) || empty($item['contact_type'])) return '超级管理员类型为空';
|
||||||
if(!isset($item['contact_name']) || empty($item['contact_name'])) return '超级管理员姓名为空';
|
if(!isset($item['contact_name']) || empty($item['contact_name'])) return '超级管理员姓名为空';
|
||||||
if(!isset($item['contact_id_card_number']) || empty($item['contact_id_card_number'])) return '超级管理员身份证件号码为空';
|
if(!isset($item['contact_id_card_number']) || empty($item['contact_id_card_number'])) return '超级管理员身份证件号码为空';
|
||||||
if(!isset($item['mobile_phone']) || empty($item['mobile_phone'])) return '超级管理员手机为空';
|
if(!isset($item['mobile_phone']) || empty($item['mobile_phone'])) return '超级管理员手机为空';
|
||||||
|
|
||||||
if(!in_array($data['organization_type'],['2401','2500'])){
|
if(!in_array($data['organization_type'],['2401','2500'])){
|
||||||
if(!isset($item['contact_email']) || empty($item['contact_email'])) return '邮箱为空';
|
if(!isset($item['contact_email']) || empty($item['contact_email'])) return '邮箱为空';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($item['contact_type'] === 66) //当超级管理员类型为66(经办人时)
|
if($item['contact_type'] === 66) //当超级管理员类型为66(经办人时)
|
||||||
{
|
{
|
||||||
if(!isset($item['contact_id_doc_type']) || empty($item['contact_id_doc_type']) || !in_array($item['contact_id_doc_type'],[1,2,3,4,5,6,7,8])) return '超级管理员证件类型为空或不合法';
|
if(!isset($item['contact_id_doc_type']) || empty($item['contact_id_doc_type']) || !in_array($item['contact_id_doc_type'],[1,2,3,4,5,6,7,8])) return '超级管理员证件类型为空或不合法';
|
||||||
if(!isset($item['contact_id_doc_copy']) || empty($item['contact_id_doc_copy'])) return '超级管理员信息证件正面照片为空';
|
if(!isset($item['contact_id_doc_copy']) || empty($item['contact_id_doc_copy'])) return '超级管理员信息证件正面照片为空';
|
||||||
if($item['contact_id_doc_type'] !== 2) //护照不需要传反面
|
if($item['contact_id_doc_type'] !== 2) //护照不需要传反面
|
||||||
{
|
{
|
||||||
if(!isset($item['contact_id_doc_copy_back']) || empty($item['contact_id_doc_copy_back'])) return '超级管理员信息证件反面照片为空';
|
if(!isset($item['contact_id_doc_copy_back']) || empty($item['contact_id_doc_copy_back'])) return '超级管理员信息证件反面照片为空';
|
||||||
}
|
}
|
||||||
if(!isset($item['contact_id_doc_period_begin']) || empty($item['contact_id_doc_period_begin'])) return '超级管理员信息证件有效期开始时间为空';
|
if(!isset($item['contact_id_doc_period_begin']) || empty($item['contact_id_doc_period_begin'])) return '超级管理员信息证件有效期开始时间为空';
|
||||||
if(!isset($item['contact_id_doc_period_end']) || empty($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期为空';
|
if(!isset($item['contact_id_doc_period_end']) || empty($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期为空';
|
||||||
|
|
||||||
if($item['contact_id_doc_period_end'] !== '长期') {
|
if($item['contact_id_doc_period_end'] !== '长期') {
|
||||||
$statr = time();
|
$statr = time();
|
||||||
$end = strtotime($item['contact_id_doc_period_end']);
|
$end = strtotime($item['contact_id_doc_period_end']);
|
||||||
$t = $end - $statr;
|
$t = $end - $statr;
|
||||||
if(($t/(3600 * 24)) <= 60) return '超级管理员信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
|
if(($t/(3600 * 24)) <= 60) return '超级管理员信息证件结束日期必须大于60天,即结束时间距当前时间需超过60天';
|
||||||
if(strtotime($item['contact_id_doc_period_begin']) >= strtotime($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期必须大于证件开始时间';
|
if(strtotime($item['contact_id_doc_period_begin']) >= strtotime($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期必须大于证件开始时间';
|
||||||
}
|
}
|
||||||
if(!isset($item['business_authorization_letter']) || empty($item['business_authorization_letter'])) return '超级管理员信息业务办理授权函为空';
|
if(!isset($item['business_authorization_letter']) || empty($item['business_authorization_letter'])) return '超级管理员信息业务办理授权函为空';
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 店铺信息
|
* TODO 店铺信息
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/22/21
|
* @day 6/22/21
|
||||||
*/
|
*/
|
||||||
protected function checkSalesSceneInfo($item,$rule,$data)
|
protected function checkSalesSceneInfo($item,$rule,$data)
|
||||||
{
|
{
|
||||||
if(empty($item)) return '店铺信息为空';
|
if(empty($item)) return '店铺信息为空';
|
||||||
|
|
||||||
if(!isset($item['store_name']) || empty($item['store_name'])) return '店铺名称为空';
|
if(!isset($item['store_name']) || empty($item['store_name'])) return '店铺名称为空';
|
||||||
|
|
||||||
if(!isset($item['store_url']) && !isset($item['store_url'])) return '店铺链接和店铺二维码二选一';
|
if(!isset($item['store_url']) && !isset($item['store_url'])) return '店铺链接和店铺二维码二选一';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO 补充说明s
|
* TODO 补充说明s
|
||||||
* @param $item
|
* @param $item
|
||||||
* @param $rule
|
* @param $rule
|
||||||
* @param $data
|
* @param $data
|
||||||
* @return bool|string
|
* @return bool|string
|
||||||
* @author Qinii
|
* @author Qinii
|
||||||
* @day 6/24/21
|
* @day 6/24/21
|
||||||
*/
|
*/
|
||||||
protected function checkBusinessAdditionDesc($item,$rule,$data)
|
protected function checkBusinessAdditionDesc($item,$rule,$data)
|
||||||
{
|
{
|
||||||
if($data['organization_type'] == 2500 && empty($item)) return '若主体为“个人卖家”:补充说明不能为空';
|
if($data['organization_type'] == 2500 && empty($item)) return '若主体为“个人卖家”:补充说明不能为空';
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace app\validate\merchant\admin;
|
namespace app\validate\merchant\admin;
|
||||||
|
|
||||||
|
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
class MerchantTypeValidate extends Validate
|
class MerchantTypeValidate extends Validate
|
||||||
{
|
{
|
||||||
protected $failException = true;
|
protected $failException = true;
|
||||||
|
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'type_name|店铺类型名称' => 'require|max:5',
|
'type_name|店铺类型名称' => 'require|max:5',
|
||||||
'type_info|店铺类型要求' => 'max:256',
|
'type_info|店铺类型要求' => 'max:256',
|
||||||
'is_margin|是否有保证金' => 'require|in:0,1',
|
'is_margin|是否有保证金' => 'require|in:0,1',
|
||||||
'auth|权限' => 'require|array|min:1',
|
'auth|权限' => 'require|array|min:1',
|
||||||
'margin|保证金(¥)' => 'requireIf:is_margin,1',
|
'margin|保证金(¥)' => 'requireIf:is_margin,1',
|
||||||
'description|其他说明' => 'max:256',
|
'description|其他说明' => 'max:256',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user