Merge branch 'monanxiao'
This commit is contained in:
commit
6245f83ccb
@ -9,6 +9,8 @@ use think\facade\Config;
|
||||
use think\facade\Request;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Db;
|
||||
use app\admin\model\StoreCategory; // 商品分类模型
|
||||
|
||||
//获取后台模块当前登录用户的信息
|
||||
function get_login_admin($key = "")
|
||||
{
|
||||
@ -93,6 +95,7 @@ function set_recursion($result, $pid = 0, $level=-1)
|
||||
static $list = array();
|
||||
static $space = ['','├─','§§├─','§§§§├─','§§§§§§├─'];
|
||||
$level++;
|
||||
|
||||
foreach ($result as $k => $v) {
|
||||
if ($v['pid'] == $pid) {
|
||||
if ($pid != 0) {
|
||||
@ -103,9 +106,40 @@ function set_recursion($result, $pid = 0, $level=-1)
|
||||
set_recursion($result, $v['id'],$level);
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
//读取商品分类节点列表
|
||||
function get_product_calss()
|
||||
{
|
||||
$result = StoreCategory::select()->toArray();
|
||||
return $result;
|
||||
}
|
||||
|
||||
//递归排序,用于分类选择
|
||||
function set_product_recursion($result, $pid = 0, $level=-1)
|
||||
{
|
||||
/*记录排序后的类别数组*/
|
||||
static $list = array();
|
||||
static $space = ['','├─','§§├─','§§§§├─','§§§§§§├─'];
|
||||
$level++;
|
||||
|
||||
foreach ($result as $k => $v) {
|
||||
if ($v['pid'] == $pid) {
|
||||
if ($pid != 0) {
|
||||
$v['cate_name'] = $space[$level] . $v['cate_name'];
|
||||
}
|
||||
/*将该类别的数据放入list中*/
|
||||
$list[] = $v;
|
||||
set_product_recursion($result, $v['store_category_id'],$level);
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id递归返回子数据
|
||||
* @param $data 数据
|
||||
|
262
app/admin/controller/product/Classify.php
Normal file
262
app/admin/controller/product/Classify.php
Normal file
@ -0,0 +1,262 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\StoreCategory; // 商品分类模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品分类控制器
|
||||
*
|
||||
*/
|
||||
class Classify extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->url=[
|
||||
'/admin/product.classify/index?category_id='.$this->category_id,
|
||||
'/admin/product.classify/add',
|
||||
'/admin/product.classify/edit',
|
||||
'/admin/product.classify/delete'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 商城分类列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = StoreCategory::where('mer_id', 0)->where($where)->count();
|
||||
|
||||
// $list = StoreCategory::with(['merchant', 'street', 'area'])->order('id desc')->select();
|
||||
$list = StoreCategory::where('mer_id', 0)->order('store_category_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$list = StoreCategory::where('mer_id', 0)->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$param = get_params();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
$param['src'] = preg_replace('# #','',$param['src']);
|
||||
if ($param['id'] > 0) {
|
||||
try {
|
||||
validate(RuleCheck::class)->scene('edit')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
Db::name('AdminRule')->strict(false)->field(true)->update($param);
|
||||
add_log('edit', $param['id'], $param);
|
||||
} else {
|
||||
try {
|
||||
validate(RuleCheck::class)->scene('add')->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
$param['create_time'] = time();
|
||||
$rid = Db::name('AdminRule')->strict(false)->field(true)->insertGetId($param);
|
||||
//自动为系统所有者管理组分配新增的节点
|
||||
$group = Db::name('AdminGroup')->find(1);
|
||||
if (!empty($group)) {
|
||||
$newGroup['id'] = 1;
|
||||
$newGroup['rules'] = $group['rules'] . ',' . $rid;
|
||||
Db::name('AdminGroup')->strict(false)->field(true)->update($newGroup);
|
||||
add_log('add', $rid, $param);
|
||||
}
|
||||
}
|
||||
// 删除后台节点缓存
|
||||
clear_cache('adminRules');
|
||||
return to_assign();
|
||||
} else {
|
||||
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$pid = isset($param['pid']) ? $param['pid'] : 0;
|
||||
|
||||
if($id > 0){
|
||||
$detail = StoreCategory::find($id); // 分类模型
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
|
||||
$storeCategoryList = StoreCategory::select();
|
||||
|
||||
View::assign('storeCategoryList', $storeCategoryList);
|
||||
View::assign('url', $this->url);
|
||||
|
||||
View::assign('id', $id);
|
||||
View::assign('pid', $pid);
|
||||
return view();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 编辑
|
||||
*
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['id'] = $params['id']; // 当前ID
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据更新
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']);
|
||||
$res = $supplyChain->update($data);
|
||||
|
||||
// 获取关联数据一对一---曲线救国
|
||||
$linkMerchant = $supplyChain['linkMerchant'];
|
||||
// $linkMerchantArr = $linkMerchant->column('id');
|
||||
|
||||
// 先删除关联数据-- 曲线救国
|
||||
$linkMerchant->delete();
|
||||
|
||||
// 关联商户状态
|
||||
if($data['mer_id_list'])
|
||||
{
|
||||
// 再重新将关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$supplyChain->linkMerchant()->save($dataLink);
|
||||
}
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
$category = StoreCategory::find($id); // 取出当前供应链数据
|
||||
|
||||
View::assign('detail', $category);
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 删除
|
||||
*
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($id);
|
||||
// 删除关联模型
|
||||
$res = $supplyChain->together(['linkMerchant'])->delete();
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}
|
||||
|
||||
}
|
263
app/admin/controller/product/Comment.php
Normal file
263
app/admin/controller/product/Comment.php
Normal file
@ -0,0 +1,263 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\StoreCategory; // 商品分类模型
|
||||
use app\admin\model\StoreProductReply; // 商品评论模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品评论控制器
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Comment extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->url=[
|
||||
'/admin/product.comment/index?category_id='.$this->category_id,
|
||||
'/admin/product.comment/add',
|
||||
'/admin/product.comment/edit',
|
||||
'/admin/product.comment/del',
|
||||
'/admin/product.comment/index',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品评论列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = StoreProductReply::where($where)->count();
|
||||
|
||||
$list = StoreProductReply::with(['product'])->order('reply_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$list = StoreProductReply::select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户
|
||||
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据入库
|
||||
$res = SupplyChain::create($data);
|
||||
|
||||
// 关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$res->linkMerchant()->save($dataLink); // 插入关联数据
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('editor', get_system_config('other','editor'));
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 编辑
|
||||
*
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['id'] = $params['id']; // 当前ID
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据更新
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']);
|
||||
$res = $supplyChain->update($data);
|
||||
|
||||
// 获取关联数据一对一---曲线救国
|
||||
$linkMerchant = $supplyChain['linkMerchant'];
|
||||
// $linkMerchantArr = $linkMerchant->column('id');
|
||||
|
||||
// 先删除关联数据-- 曲线救国
|
||||
$linkMerchant->delete();
|
||||
|
||||
// 关联商户状态
|
||||
if($data['mer_id_list'])
|
||||
{
|
||||
// 再重新将关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$supplyChain->linkMerchant()->save($dataLink);
|
||||
}
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
$supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据
|
||||
|
||||
View::assign('detail', $supplyChain);
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 删除
|
||||
*
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$id = get_params("id");
|
||||
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
$res = StoreProductReply::where('reply_id', $id)->delete();
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}
|
||||
|
||||
}
|
264
app/admin/controller/product/Label.php
Normal file
264
app/admin/controller/product/Label.php
Normal file
@ -0,0 +1,264 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\StoreCategory; // 商品分类模型
|
||||
use app\admin\model\StoreProductReply; // 商品评论模型
|
||||
use app\admin\model\StoreProductLabel; // 商品标签模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品标签控制器
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Label extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->url=[
|
||||
'/admin/product.label/index?category_id='.$this->category_id,
|
||||
'/admin/product.label/add',
|
||||
'/admin/product.label/edit',
|
||||
'/admin/product.label/del',
|
||||
'/admin/product.label/index',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品评论列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = StoreProductLabel::where($where)->count();
|
||||
|
||||
$list = StoreProductLabel::with(['product'])->order('product_label_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$list = StoreProductLabel::select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户
|
||||
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据入库
|
||||
$res = SupplyChain::create($data);
|
||||
|
||||
// 关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$res->linkMerchant()->save($dataLink); // 插入关联数据
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('editor', get_system_config('other','editor'));
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 编辑
|
||||
*
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['id'] = $params['id']; // 当前ID
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据更新
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']);
|
||||
$res = $supplyChain->update($data);
|
||||
|
||||
// 获取关联数据一对一---曲线救国
|
||||
$linkMerchant = $supplyChain['linkMerchant'];
|
||||
// $linkMerchantArr = $linkMerchant->column('id');
|
||||
|
||||
// 先删除关联数据-- 曲线救国
|
||||
$linkMerchant->delete();
|
||||
|
||||
// 关联商户状态
|
||||
if($data['mer_id_list'])
|
||||
{
|
||||
// 再重新将关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$supplyChain->linkMerchant()->save($dataLink);
|
||||
}
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
$supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据
|
||||
|
||||
View::assign('detail', $supplyChain);
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 删除
|
||||
*
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$id = get_params("id");
|
||||
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
$res = StoreProductReply::where('reply_id', $id)->delete();
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}
|
||||
|
||||
}
|
262
app/admin/controller/product/Product.php
Normal file
262
app/admin/controller/product/Product.php
Normal file
@ -0,0 +1,262 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\EbStoreProduct; // 商品模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品控制器
|
||||
*
|
||||
*/
|
||||
class Product extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->url=[
|
||||
'/admin/product.product/index?category_id='.$this->category_id,
|
||||
'/admin/product.product/add',
|
||||
'/admin/product.product/edit',
|
||||
'/admin/product.product/delete',
|
||||
'/admin/product.product/index',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 供应链团队列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = EbStoreProduct::where($where)->count();
|
||||
|
||||
$list = EbStoreProduct::with(['merchant' => ['merchantType', 'category']])->order('product_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$list = SupplyChain::with(['merchant' => ['merchantType', 'category']])->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户
|
||||
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据入库
|
||||
$res = SupplyChain::create($data);
|
||||
|
||||
// 关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$res->linkMerchant()->save($dataLink); // 插入关联数据
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('editor', get_system_config('other','editor'));
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 编辑
|
||||
*
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['id'] = $params['id']; // 当前ID
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据更新
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']);
|
||||
$res = $supplyChain->update($data);
|
||||
|
||||
// 获取关联数据一对一---曲线救国
|
||||
$linkMerchant = $supplyChain['linkMerchant'];
|
||||
// $linkMerchantArr = $linkMerchant->column('id');
|
||||
|
||||
// 先删除关联数据-- 曲线救国
|
||||
$linkMerchant->delete();
|
||||
|
||||
// 关联商户状态
|
||||
if($data['mer_id_list'])
|
||||
{
|
||||
// 再重新将关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$supplyChain->linkMerchant()->save($dataLink);
|
||||
}
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
$supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据
|
||||
|
||||
View::assign('detail', $supplyChain);
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 删除
|
||||
*
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($id);
|
||||
// 删除关联模型
|
||||
$res = $supplyChain->together(['linkMerchant'])->delete();
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}
|
||||
|
||||
}
|
257
app/admin/controller/supplychain/Index.php
Normal file
257
app/admin/controller/supplychain/Index.php
Normal file
@ -0,0 +1,257 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\controller\supplychain;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->url=[
|
||||
'/admin/supplychain.index/index?category_id='.$this->category_id,
|
||||
'/admin/supplychain.index/add',
|
||||
'/admin/supplychain.index/edit',
|
||||
'/admin/supplychain.index/delete',
|
||||
'/admin/supplychain.merchant/index',
|
||||
'/admin/supplychain.merchant/bill',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 供应链团队列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where[]= ['status','=',0];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = SupplyChain::where($where)->count();
|
||||
|
||||
$list = SupplyChain::with(['merchant', 'street', 'area'])->order('id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$list = SupplyChain::select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户
|
||||
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据入库
|
||||
$res = SupplyChain::create($data);
|
||||
|
||||
// 关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$res->linkMerchant()->save($dataLink); // 插入关联数据
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('editor', get_system_config('other','editor'));
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 编辑
|
||||
*
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params = get_params();
|
||||
|
||||
$data['id'] = $params['id']; // 当前ID
|
||||
$data['user_id'] = $this->adminInfo['id']; // 操作用户ID
|
||||
$data['name'] = $params['title']; // 团队名称
|
||||
$data['tel'] = $params['phone']; // 联系电话
|
||||
$data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户
|
||||
$data['street_id'] = $params['street_id']; // 街道ID
|
||||
$street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据
|
||||
$data['lng'] = $street['lng']; // 经度
|
||||
$data['lat'] = $street['lat']; // 纬度
|
||||
$area = $street->area; // 区数据
|
||||
$data['area_id'] = $area['area_id']; // 区县id
|
||||
$city = $area->city; // 获取市级
|
||||
$data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据更新
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']);
|
||||
$res = $supplyChain->update($data);
|
||||
|
||||
// 获取关联数据一对一---曲线救国
|
||||
$linkMerchant = $supplyChain['linkMerchant'];
|
||||
// $linkMerchantArr = $linkMerchant->column('id');
|
||||
|
||||
// 先删除关联数据-- 曲线救国
|
||||
$linkMerchant->delete();
|
||||
|
||||
// 关联商户状态
|
||||
if($data['mer_id_list'])
|
||||
{
|
||||
// 再重新将关联数据入库
|
||||
foreach ($params['mer_id'] as $v) {
|
||||
|
||||
$dataLink = [
|
||||
'eb_merchant_id' => $v, // 商户ID
|
||||
'user_id' => $data['user_id'],
|
||||
'create_time' => $data['create_time'],
|
||||
];
|
||||
|
||||
$supplyChain->linkMerchant()->save($dataLink);
|
||||
}
|
||||
}
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
||||
$supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据
|
||||
|
||||
View::assign('detail', $supplyChain);
|
||||
|
||||
// 取出正常的商家
|
||||
$merchant = Merchant::where('status', 1)->column('mer_id, real_name');
|
||||
// 区域模型
|
||||
$arealist = GeoArea::where('city_code', '510500')->select();
|
||||
|
||||
View::assign('arealist', $arealist);
|
||||
View::assign('merchant', $merchant);
|
||||
View::assign('url', $this->url);
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 删除
|
||||
*
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$id = get_params("id");
|
||||
if(!$id) return to_assign(1, '非法操作!');
|
||||
|
||||
$supplyChain = SupplyChain::with(['linkMerchant'])->find($id);
|
||||
// 删除关联模型
|
||||
$res = $supplyChain->together(['linkMerchant'])->delete();
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}
|
||||
|
||||
}
|
185
app/admin/controller/supplychain/Merchant.php
Normal file
185
app/admin/controller/supplychain/Merchant.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\controller\supplychain;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant as MerchantModel; // 商户模型
|
||||
use app\admin\model\StoreOrder as StoreOrderModel; // 商户订单模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\admin\model\SupplyChainLinkMerchant; // 供应链关联商户模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
class Merchant extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->url=[
|
||||
'/admin/supplychain.index/index?category_id='.$this->category_id,
|
||||
'/admin/supplychain.index/add',
|
||||
'/admin/supplychain.index/edit',
|
||||
'/admin/supplychain.index/delete',
|
||||
'/admin/supplychain.merchant/index',
|
||||
'/admin/supplychain.merchant/bill',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 供应链团队列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = SupplyChainLinkMerchant::where($where)->count();
|
||||
|
||||
$list = SupplyChainLinkMerchant::with(['supplyChain', 'merchant'])->order('id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$total = SupplyChainLinkMerchant::count();
|
||||
$list = SupplyChainLinkMerchant::with(['merchant', 'supplyChain'])->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 交易订单
|
||||
*
|
||||
*/
|
||||
public function bill()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
$total = StoreOrderModel::where($where)->count();
|
||||
|
||||
$list = StoreOrderModel::with(['merchant'])->order('order_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
}else{
|
||||
|
||||
$total = StoreOrderModel::count();
|
||||
$list = StoreOrderModel::with(['merchant'])->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 编辑
|
||||
*
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 删除
|
||||
*
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
return view();
|
||||
}
|
||||
|
||||
}
|
31
app/admin/model/EbStoreProduct.php
Normal file
31
app/admin/model/EbStoreProduct.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月04日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 订单模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class EbStoreProduct extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_product';
|
||||
protected $pk = 'product_id';
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
|
||||
}
|
||||
}
|
26
app/admin/model/GeoArea.php
Normal file
26
app/admin/model/GeoArea.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 地区 区域模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class GeoArea extends Model
|
||||
{
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_geo_area';
|
||||
|
||||
/**
|
||||
* 关联市
|
||||
*/
|
||||
public function city()
|
||||
{
|
||||
return $this->hasOne(GeoArea::class, 'area_code', 'area_code');
|
||||
}
|
||||
}
|
19
app/admin/model/GeoCity.php
Normal file
19
app/admin/model/GeoCity.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 地区 省市模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class GeoCity extends Model
|
||||
{
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_geo_city';
|
||||
|
||||
}
|
27
app/admin/model/GeoStreet.php
Normal file
27
app/admin/model/GeoStreet.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 地区 街道模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class GeoStreet extends Model
|
||||
{
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_geo_street';
|
||||
|
||||
/**
|
||||
* 关联区
|
||||
*
|
||||
*/
|
||||
public function area()
|
||||
{
|
||||
return $this->hasOne(GeoArea::class, 'area_code', 'area_code');
|
||||
}
|
||||
}
|
52
app/admin/model/Merchant.php
Normal file
52
app/admin/model/Merchant.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 商户模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Merchant extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_merchant';
|
||||
protected $pk = 'mer_id';
|
||||
|
||||
/**
|
||||
* 所属供应链
|
||||
* 远程一对一
|
||||
*
|
||||
*/
|
||||
public function supplyChain()
|
||||
{
|
||||
return $this->hasOneThrough(SupplyChainLinkMerchant::class, SupplyChain::class);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户类型
|
||||
*
|
||||
*/
|
||||
public function merchantType()
|
||||
{
|
||||
return $this->hasOne(MerchantType::class, 'mer_type_id', 'type_id');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户类别
|
||||
*
|
||||
*/
|
||||
public function category()
|
||||
{
|
||||
return $this->hasOne(MerchantCategory::class, 'merchant_category_id', 'category_id');
|
||||
}
|
||||
|
||||
}
|
22
app/admin/model/MerchantCategory.php
Normal file
22
app/admin/model/MerchantCategory.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月04日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 商户分类模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class MerchantCategory extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_merchant_category';
|
||||
protected $pk = 'merchant_category_id';
|
||||
|
||||
}
|
22
app/admin/model/MerchantType.php
Normal file
22
app/admin/model/MerchantType.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月04日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 商户类型模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class MerchantType extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_merchant_type';
|
||||
protected $pk = 'mer_type_id';
|
||||
|
||||
}
|
40
app/admin/model/StoreCart.php
Normal file
40
app/admin/model/StoreCart.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 购物车模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class StoreCart extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_cart';
|
||||
protected $pk = 'cart_id';
|
||||
|
||||
/**
|
||||
* 所属商品
|
||||
*
|
||||
*/
|
||||
public function product()
|
||||
{
|
||||
return $this->hasOne(EbStoreProduct::class, 'product_id', 'product_id');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 所属用户
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
|
||||
}
|
||||
}
|
22
app/admin/model/StoreCategory.php
Normal file
22
app/admin/model/StoreCategory.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 商品分类模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class StoreCategory extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_category';
|
||||
protected $pk = 'store_category_id';
|
||||
|
||||
}
|
64
app/admin/model/StoreOrder.php
Normal file
64
app/admin/model/StoreOrder.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 订单模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class StoreOrder extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_order';
|
||||
protected $pk = 'order_id';
|
||||
|
||||
/**
|
||||
* 所属商户
|
||||
* 一对一
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 所属商品
|
||||
*
|
||||
*/
|
||||
public function cart()
|
||||
{
|
||||
return $this->hasOne(StoreCart::class, 'cart_id', 'cart_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车商品
|
||||
*
|
||||
*/
|
||||
public function getCartIdAttr($value)
|
||||
{
|
||||
// 分割为数组
|
||||
$cartId = explode(',', $value);
|
||||
// 购物车ID
|
||||
$scartList = StoreCart::whereIn('cart_id', $cartId)->with(['product'])->select();
|
||||
|
||||
return $scartList;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 所属用户
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
|
||||
}
|
||||
}
|
51
app/admin/model/StoreProductLabel.php
Normal file
51
app/admin/model/StoreProductLabel.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 商品标签模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class StoreProductLabel extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_product_label';
|
||||
protected $pk = 'product_label_id';
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联用户
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商品
|
||||
*
|
||||
*/
|
||||
public function product()
|
||||
{
|
||||
return $this->hasOne(EbStoreProduct::class, 'product_id', 'product_id');
|
||||
}
|
||||
}
|
51
app/admin/model/StoreProductReply.php
Normal file
51
app/admin/model/StoreProductReply.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 商品评论模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class StoreProductReply extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_product_reply';
|
||||
protected $pk = 'reply_id';
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联用户
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商品
|
||||
*
|
||||
*/
|
||||
public function product()
|
||||
{
|
||||
return $this->hasOne(EbStoreProduct::class, 'product_id', 'product_id');
|
||||
}
|
||||
}
|
60
app/admin/model/SupplyChain.php
Normal file
60
app/admin/model/SupplyChain.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 供应链团队模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class SupplyChain extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'mysql';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_supply_chain';
|
||||
|
||||
/**
|
||||
* 关联拥有多个商户
|
||||
* 远程一对多
|
||||
* 关联模型、中间模型
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasManyThrough(Merchant::class, SupplyChainLinkMerchant::class, 'fa_supply_chain_id', 'mer_id', 'id', 'eb_merchant_id');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联中间表
|
||||
*
|
||||
*/
|
||||
public function linkMerchant()
|
||||
{
|
||||
return $this->hasMany(SupplyChainLinkMerchant::class, 'fa_supply_chain_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联街道
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function street()
|
||||
{
|
||||
return $this->hasOne(GeoStreet::class, 'street_id', 'street_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联区县
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function area()
|
||||
{
|
||||
return $this->hasOne(GeoArea::class, 'area_id', 'area_id');
|
||||
}
|
||||
}
|
44
app/admin/model/SupplyChainLinkMerchant.php
Normal file
44
app/admin/model/SupplyChainLinkMerchant.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月02日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 供应链团队和商户中间件模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
use think\model\Pivot;
|
||||
|
||||
class SupplyChainLinkMerchant extends Pivot
|
||||
{
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'mysql';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_supply_chain_link_merchant';
|
||||
|
||||
/**
|
||||
* 所属供应链
|
||||
* 一对一
|
||||
*
|
||||
*/
|
||||
public function supplyChain()
|
||||
{
|
||||
return $this->hasOne(SupplyChain::class, 'id', 'fa_supply_chain_id');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 所属商户
|
||||
* 一对一
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class, 'mer_id', 'eb_merchant_id');
|
||||
}
|
||||
}
|
96
app/admin/view/product/Label/add.html
Normal file
96
app/admin/view/product/Label/add.html
Normal file
@ -0,0 +1,96 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
|
||||
.layui-td-gray {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.addrhelper-ok-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">添加</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">姓名<font>*</font></td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="name" lay-verify="required" lay-reqText="请输入负责人姓名"
|
||||
autocomplete="off" placeholder="请输入负责人姓名" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">职务<font>*</font></td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="duty" lay-verify="required" lay-reqText="请输入负责人职务"
|
||||
autocomplete="off" placeholder="请输入负责人职务" class="layui-input">
|
||||
</td>
|
||||
<td class="layui-td-gray">电话<font>*</td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="phone" lay-verify="required" lay-reqText="请输入负责人电话"
|
||||
autocomplete="off" placeholder="请输入负责人电话" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
|
||||
<script>
|
||||
const editorType = '{$editor}';
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, laydate = layui.laydate;
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.lng = $('.lng').text();
|
||||
data.field.lat = $('.lat').text();
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
setTimeout(function () {
|
||||
parent.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
tool.post('/admin/nk.areamanager/add', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
188
app/admin/view/product/Label/edit.html
Normal file
188
app/admin/view/product/Label/edit.html
Normal file
@ -0,0 +1,188 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<input type="hidden" name="id" value="{$detail.store_category_id}">
|
||||
<h3 class="pb-3">编辑</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >上级分类</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">分类名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" value="{$detail.cate_name}" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传分类图片(尺寸:110x110)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="{$detail.pic}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="is_show" lay-skin="switch" {$detail.is_show?'checked':''}>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">排序<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sort" required lay-verify="required" value="{$detail.sort}" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[2]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
street("{$detail.store_category_id}");
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'pid',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: ['{$detail.pid}'],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
200
app/admin/view/product/Label/index.html
Normal file
200
app/admin/view/product/Label/index.html
Normal file
@ -0,0 +1,200 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入供应链名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加商品标签">+ 添加商品标签</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if} -->
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if} -->
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'reply_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
field: 'store_name',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.product.store_name;
|
||||
},
|
||||
},{
|
||||
field: 'pic',
|
||||
title: '商品图',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="data:image/png;base64,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">
|
||||
</div>`;
|
||||
if(d.product.image)
|
||||
{
|
||||
html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="` + d.product.image + `" />
|
||||
</div>`;
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'nickname',
|
||||
title: '用户名称',
|
||||
align: 'center',
|
||||
width:150,
|
||||
|
||||
},{
|
||||
field: 'product_score',
|
||||
title: '产品评分',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'service_score',
|
||||
title: '服务评分',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'postage_score',
|
||||
title: '物流评分',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'comment',
|
||||
title: '评价内容',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'merchant_reply_content',
|
||||
title: '回复内容',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '评论时间',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.reply_id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
147
app/admin/view/product/classify/add.html
Normal file
147
app/admin/view/product/classify/add.html
Normal file
@ -0,0 +1,147 @@
|
||||
{extend name="common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">添加分类</h3>
|
||||
{if condition="$id eq 0"}
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray-2">上级分类<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<select name="pid" lay-verify="required" lay-reqText="请选择上级分类" lay-search="">
|
||||
<option value="0">请选择上级分类</option>
|
||||
{volist name=":set_product_recursion(get_product_calss())" id="v"}
|
||||
<option value="{$v.store_category_id}" {eq name="pid" value="$v.store_category_id" }selected="" {/eq}>{$v.cate_name} </option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">分类名称<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入分类名称"
|
||||
lay-reqText="请输入分类名称" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">排序</td>
|
||||
<td>
|
||||
<input type="text" name="sort" value="0" placeholder="请输入数字,越小越靠前" autocomplete="off"
|
||||
class="layui-input">
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="switch" lay-skin="switch">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">分类图片</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传缩略图(尺寸:110*110px)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
{else/}
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray-2">父级菜单/节点<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<select name="pid" lay-verify="required" lay-reqText="请选择父级菜单/节点">
|
||||
<option value="0">作为顶级节点</option>
|
||||
{volist name=":set_recursion(get_admin_rule())" id="v"}
|
||||
<option value="{$v.id}" {eq name="$detail.pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray-2">左侧菜单显示<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<input type="radio" name="menu" value="1" title="是" {eq name="$detail.menu" value="1" } checked{/eq}>
|
||||
<input type="radio" name="menu" value="2" title="不是" {eq name="$detail.menu" value="2" } checked{/eq}>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">菜单/节点名称<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="title" value="{$detail.title}" lay-verify="required" autocomplete="off"
|
||||
placeholder="请输入菜单/节点名称" lay-reqText="请输入菜单/节点名称" class="layui-input">
|
||||
</td>
|
||||
<td class="layui-td-gray">操作日志名称<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="name" value="{$detail.name}" lay-verify="required" placeholder="请输入操作日志名称"
|
||||
lay-reqText="请输入操作日志名称" autocomplete="off" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">菜单/节点URL</td>
|
||||
<td>
|
||||
<input type="text" name="src" value="{$detail.src}" placeholder="请输入菜单/节点URL,可空" autocomplete="off"
|
||||
class="layui-input">
|
||||
</td>
|
||||
<td class="layui-td-gray">菜单排序</td>
|
||||
<td>
|
||||
<input type="text" name="sort" value="{$detail.sort}" placeholder="请输入数字,越小越靠前" autocomplete="off"
|
||||
class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">菜单图标</td>
|
||||
<td colspan="3">
|
||||
<input style="width:150px; display:inline" type="text" name="icon" value="{$detail.icon}" placeholder="请输入图标,可空" autocomplete="off" class="layui-input">
|
||||
<i class="bi {$detail.icon}"></i><a href="{__GOUGU__}/icon/index.html" target="_blank" style="margin-left:10px; color:#007AFF">[查看图标]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
<div style="padding: 10px 0">
|
||||
<input type="hidden" name="id" value="{$id}">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool=layui.tool;
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
if (!data.field.menu || data.field.menu == '') {
|
||||
layer.msg('请选择是否在左侧菜单显示');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
setTimeout(function () {
|
||||
parent.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/product.classify/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
188
app/admin/view/product/classify/edit.html
Normal file
188
app/admin/view/product/classify/edit.html
Normal file
@ -0,0 +1,188 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<input type="hidden" name="id" value="{$detail.store_category_id}">
|
||||
<h3 class="pb-3">编辑</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >上级分类</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">分类名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" value="{$detail.cate_name}" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传分类图片(尺寸:110x110)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="{$detail.pic}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="is_show" lay-skin="switch" {$detail.is_show?'checked':''}>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">排序<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sort" required lay-verify="required" value="{$detail.sort}" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[2]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
street("{$detail.store_category_id}");
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'pid',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: ['{$detail.pid}'],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
140
app/admin/view/product/classify/index.html
Normal file
140
app/admin/view/product/classify/index.html
Normal file
@ -0,0 +1,140 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入供应链名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<div class="gg-form-bar border-t border-x">
|
||||
<button class="layui-btn layui-btn-sm add-menu">+ 添加分类</button>
|
||||
</div>
|
||||
<div>
|
||||
<table class="layui-hide" id="treeTable" lay-filter="treeTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if} -->
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool', 'treeGrid'];
|
||||
function gouguInit() {
|
||||
var treeGrid = layui.treeGrid,table = layui.table, tool = layui.tool;
|
||||
var pageTable = treeGrid.render({
|
||||
id: 'treeTable'
|
||||
, elem: '#treeTable'
|
||||
, idField: 'store_category_id'
|
||||
, url: "/admin/product.classify/index"
|
||||
, cellMinWidth: 80
|
||||
, treeId: 'store_category_id'//树形id字段名称
|
||||
, treeUpId: 'pid'//树形父id字段名称
|
||||
, treeShowName: 'cate_name'//以树形式显示的字段
|
||||
, cols: [[
|
||||
{ field: 'store_category_id', width: 80, title: 'ID号', align: 'center' }
|
||||
,{field:'pic',title: '菜单图标',width: 80, align: 'center' ,templet: function(d){
|
||||
var html='<strong class="bi '+d.icon+'"></strong>';
|
||||
return html;
|
||||
}}
|
||||
, { field: 'cate_name', title: '菜单/节点名称' }
|
||||
// , { field: 'pid', title: '父ID', width: 80, align: 'center' }
|
||||
// , { field: 'path', title: '父级', width: 80 }
|
||||
, { field: 'sort', title: '排序', align: 'center' }
|
||||
, {
|
||||
field: 'is_show', title: '是否显示', align: 'center', templet: function (d) {
|
||||
var html = '<span style="color:#fbbc05">隐藏</span>';
|
||||
if (d.is_show == '1') {
|
||||
html = '<span style="color:#12bb37">显示</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'is_hot', title: '是否推荐', align: 'center', templet: function (d) {
|
||||
var html = '<span style="color:#fbbc05">不推荐</span>';
|
||||
if (d.is_hot == '1') {
|
||||
html = '<span style="color:#12bb37">推荐</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
}
|
||||
, {
|
||||
width: 188, title: '操作', align: 'center'
|
||||
, templet: function (d) {
|
||||
var html = '<span class="layui-btn-group"><button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button><button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';
|
||||
return html;
|
||||
}
|
||||
}
|
||||
]]
|
||||
, page: false
|
||||
});
|
||||
//表头工具栏事件
|
||||
$('.add-menu').on('click', function () {
|
||||
tool.side("/admin/product.classify/add");
|
||||
return;
|
||||
});
|
||||
|
||||
//操作按钮
|
||||
treeGrid.on('tool(treeTable)', function (obj) {
|
||||
console.log(obj);
|
||||
if (obj.event === 'add') {
|
||||
tool.side('/admin/product.classify/add?pid=' + obj.data.store_category_id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'edit') {
|
||||
tool.side('/admin/product.classify/edit?id=' + obj.data.store_category_id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/admin/product.classify/delete", { id: obj.data.store_category_id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
200
app/admin/view/product/comment/add.html
Normal file
200
app/admin/view/product/comment/add.html
Normal file
@ -0,0 +1,200 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
|
||||
.layui-td-gray {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.addrhelper-ok-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">关联商户</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >请选择商户</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">已选商户<font>*</font></label>
|
||||
<div class="layui-input-block" id="merchantList" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队电话<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="phone" required lay-verify="required" placeholder="请输入团队电话" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">请选择所在地址<font>*</font></td>
|
||||
<td>
|
||||
<div class="layui-col-md4">
|
||||
<select name="" lay-filter="merchantAddress" lay-search>
|
||||
<option value="">选择区域</option>
|
||||
{volist name='arealist' id='vo'}
|
||||
<option value="{$vo.area_code}" >{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">街道/镇</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[1]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'street_id',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: [],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false,
|
||||
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
188
app/admin/view/product/comment/edit.html
Normal file
188
app/admin/view/product/comment/edit.html
Normal file
@ -0,0 +1,188 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<input type="hidden" name="id" value="{$detail.store_category_id}">
|
||||
<h3 class="pb-3">编辑</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >上级分类</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">分类名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" value="{$detail.cate_name}" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传分类图片(尺寸:110x110)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="{$detail.pic}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="is_show" lay-skin="switch" {$detail.is_show?'checked':''}>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">排序<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sort" required lay-verify="required" value="{$detail.sort}" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[2]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
street("{$detail.store_category_id}");
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'pid',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: ['{$detail.pid}'],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
200
app/admin/view/product/comment/index.html
Normal file
200
app/admin/view/product/comment/index.html
Normal file
@ -0,0 +1,200 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入供应链名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<!-- <script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加虚拟评论">+ 添加虚拟评论</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script> -->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if} -->
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if} -->
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'reply_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
field: 'store_name',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.product.store_name;
|
||||
},
|
||||
},{
|
||||
field: 'pic',
|
||||
title: '商品图',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="data:image/png;base64,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">
|
||||
</div>`;
|
||||
if(d.product.image)
|
||||
{
|
||||
html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="` + d.product.image + `" />
|
||||
</div>`;
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'nickname',
|
||||
title: '用户名称',
|
||||
align: 'center',
|
||||
width:150,
|
||||
|
||||
},{
|
||||
field: 'product_score',
|
||||
title: '产品评分',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'service_score',
|
||||
title: '服务评分',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'postage_score',
|
||||
title: '物流评分',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'comment',
|
||||
title: '评价内容',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'merchant_reply_content',
|
||||
title: '回复内容',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '评论时间',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.reply_id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
200
app/admin/view/product/product/add.html
Normal file
200
app/admin/view/product/product/add.html
Normal file
@ -0,0 +1,200 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
|
||||
.layui-td-gray {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.addrhelper-ok-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">关联商户</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >请选择商户</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">已选商户<font>*</font></label>
|
||||
<div class="layui-input-block" id="merchantList" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队电话<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="phone" required lay-verify="required" placeholder="请输入团队电话" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">请选择所在地址<font>*</font></td>
|
||||
<td>
|
||||
<div class="layui-col-md4">
|
||||
<select name="" lay-filter="merchantAddress" lay-search>
|
||||
<option value="">选择区域</option>
|
||||
{volist name='arealist' id='vo'}
|
||||
<option value="{$vo.area_code}" >{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">街道/镇</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[1]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'street_id',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: [],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false,
|
||||
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
188
app/admin/view/product/product/edit.html
Normal file
188
app/admin/view/product/product/edit.html
Normal file
@ -0,0 +1,188 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<input type="hidden" name="id" value="{$detail.store_category_id}">
|
||||
<h3 class="pb-3">编辑</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >上级分类</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">分类名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" value="{$detail.cate_name}" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传分类图片(尺寸:110x110)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="{$detail.pic}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="is_show" lay-skin="switch" {$detail.is_show?'checked':''}>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">排序<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="sort" required lay-verify="required" value="{$detail.sort}" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[2]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
street("{$detail.store_category_id}");
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'pid',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: ['{$detail.pid}'],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
236
app/admin/view/product/product/index.html
Normal file
236
app/admin/view/product/product/index.html
Normal file
@ -0,0 +1,236 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入供应链名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<!-- <script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加虚拟评论">+ 添加虚拟评论</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script> -->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'product_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
field: 'image',
|
||||
title: '商品图',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="data:image/png;base64,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">
|
||||
</div>`;
|
||||
if(d.image)
|
||||
{
|
||||
html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="` + d.image + `" />
|
||||
</div>`;
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'store_name',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
width:120
|
||||
},{
|
||||
field: 'type_name',
|
||||
title: '商户类型',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.merchant.merchantType ? d.merchant.merchantType.type_name : '待定';
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'product_score',
|
||||
title: '商户类别',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.merchant.category ? d.merchant.category.category_name : '待定';
|
||||
}
|
||||
},{
|
||||
field: 'price',
|
||||
title: '商品售价',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'sales',
|
||||
title: '销量',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'stock',
|
||||
title: '库存',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'is_good',
|
||||
title: '推荐级别',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'is_used',
|
||||
title: '是否显示',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.is_used ? '显示' : '隐藏';
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'is_used',
|
||||
title: '商品状态',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.is_used ? '上架显示' : '平台关闭';
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'keyword',
|
||||
title: '标签',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center',
|
||||
width:180,
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.reply_id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
layui.use('rate', function(){
|
||||
var rate = layui.rate;
|
||||
|
||||
//基础效果
|
||||
rate.render({
|
||||
elem: '#is_good'
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
200
app/admin/view/supplychain/index/add.html
Normal file
200
app/admin/view/supplychain/index/add.html
Normal file
@ -0,0 +1,200 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
|
||||
.layui-td-gray {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.addrhelper-ok-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">关联商户</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >请选择商户</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">已选商户<font>*</font></label>
|
||||
<div class="layui-input-block" id="merchantList" >
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队电话<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="phone" required lay-verify="required" placeholder="请输入团队电话" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">请选择所在地址<font>*</font></td>
|
||||
<td>
|
||||
<div class="layui-col-md4">
|
||||
<select name="" lay-filter="merchantAddress" lay-search>
|
||||
<option value="">选择区域</option>
|
||||
{volist name='arealist' id='vo'}
|
||||
<option value="{$vo.area_code}" >{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">街道/镇</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[1]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'street_id',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: [],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false,
|
||||
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
209
app/admin/view/supplychain/index/edit.html
Normal file
209
app/admin/view/supplychain/index/edit.html
Normal file
@ -0,0 +1,209 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<input type="hidden" name="id" value="{$detail.id}">
|
||||
<h3 class="pb-3">编辑</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">选择商户</td>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<select lay-filter="merchant" lay-search>
|
||||
<option value="" >请选择商户</option>
|
||||
{volist name='merchant' id='vo'}
|
||||
<option id="merchant{$vo.mer_id}" value="{$vo.mer_id}" >{$vo.real_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md12">
|
||||
<label class="layui-form-label">已选商户<font>*</font></label>
|
||||
<div class="layui-input-block" id="merchantList" >
|
||||
{volist name='detail.merchant' id='vo'}
|
||||
<input type="checkbox" name="mer_id[]" value="{$vo.mer_id}" title="{$vo.mer_name}" checked>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-col-md4" id="address"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队名称<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required" value="{$detail.name}" placeholder="请输入团队名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">团队电话<font>*</font></label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="phone" required lay-verify="required" value="{$detail.tel}" placeholder="请输入团队电话" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">请选择所在地址<font>*</font></td>
|
||||
<td>
|
||||
<div class="layui-col-md4">
|
||||
<select name="" lay-filter="merchantAddress" lay-search>
|
||||
<option value="">选择区域</option>
|
||||
{volist name='arealist' id='vo'}
|
||||
{if $detail.area.area_code == $vo.area_code}
|
||||
<option value="{$vo.area_code}" selected >{$vo.area_name}</option>
|
||||
{else /}
|
||||
<option value="{$vo.area_code}" >{$vo.area_name}</option>
|
||||
{/if}
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">街道/镇</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool','tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
// 下拉选中事件
|
||||
form.on('select(merchant)', function(data){
|
||||
|
||||
if(data.value == null || data.value == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const title = $('#merchant' + data.value).text();
|
||||
const html = `<input type="checkbox" id="mer_id` + data.value + `" name="mer_id[]" title="` + title + `" value="` + data.value + `" checked/>`
|
||||
+ `<div id="mer_id_style` + data.value + `" class="layui-unselect layui-form-checkbox layui-form-checked" onclick="merchantxz(` + data.value + `)"><span>` + title + `</span><i class="layui-icon layui-icon-ok"></i></div>`;
|
||||
$('#merchantList').append(html);
|
||||
$("#merchant"+ data.value).remove();
|
||||
$(".layui-this").remove();
|
||||
});
|
||||
|
||||
form.on('select(merchantAddress)', function (data) {
|
||||
street(data.value);
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
console.log(e);
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
tool.post('{$url[2]}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
// 删除选中商户
|
||||
function merchantxz(env)
|
||||
{
|
||||
if($('#mer_id'+env).attr("checked") == 'checked')
|
||||
{
|
||||
$('#mer_id'+env).removeAttr('checked');
|
||||
$('#mer_id_style'+env).removeClass('layui-form-checked');
|
||||
}else{
|
||||
$('#mer_id'+env).attr('checked', 'checked');
|
||||
$('#mer_id_style'+env).addClass('layui-form-checked');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var group_access = "{:session('gougu_admin')['group_access']}";
|
||||
|
||||
street("{$detail.area.area_code}");
|
||||
|
||||
function street (id) {
|
||||
if(id == null || id == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'street_id',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
initValue: ['{$detail.street_id}'],
|
||||
disabled: group_access == 2 || group_access==4 ? true : false
|
||||
});
|
||||
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
|
||||
demo1.update({
|
||||
data: result.data
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
203
app/admin/view/supplychain/index/index.html
Normal file
203
app/admin/view/supplychain/index/index.html
Normal file
@ -0,0 +1,203 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入供应链名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[4])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if} -->
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
field: 'area',
|
||||
title: '地址',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
return d.area.area_name + d.street.street_name;
|
||||
},
|
||||
width:120,
|
||||
},{
|
||||
field: 'mer_id',
|
||||
title: '主商户',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.mer_id?d.mer_id:'待定';
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'name',
|
||||
title: '名称',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'tel',
|
||||
title: '联系电话',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'earnings_amount',
|
||||
title: '净收益',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'bill_amount',
|
||||
title: '流水',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'brokerage',
|
||||
title: '分销佣金',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'order_number',
|
||||
title: '支付订单数量',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'cancel_order_number',
|
||||
title: '取消支付订单数量',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = '<span style="color:#fbbc05">禁用</span>';
|
||||
if (d.status == '0') {
|
||||
html = '<span style="color:#12bb37">正常</span>';
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '添加时间',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[4]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
67
app/admin/view/supplychain/index/read.html
Normal file
67
app/admin/view/supplychain/index/read.html
Normal file
@ -0,0 +1,67 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style>
|
||||
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">标题<font>*</font></td>
|
||||
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
|
||||
autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}" readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">简介<font>*</font></td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="synopsis" readonly>{$detail.synopsis}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">内容</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="content" readonly>{$detail.content}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">坐标</td>
|
||||
<td colspan="6">
|
||||
<p>经度:{$detail.lng}</p>
|
||||
<p>纬度:{$detail.lat}</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">运输距离</td>
|
||||
<td colspan="6">
|
||||
{volist name='farmers' id='vo'}
|
||||
<p>距离 {$vo.title} {$vo.juli} 公里</p>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
138
app/admin/view/supplychain/merchant/add.html
Normal file
138
app/admin/view/supplychain/merchant/add.html
Normal file
@ -0,0 +1,138 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
|
||||
.layui-td-gray {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.addrhelper-ok-btn {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">添加</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">所属区域<font>*</font></td>
|
||||
<td colspan="12">
|
||||
<div class="layui-col-md12">
|
||||
<select name="area_id" lay-verify="required" lay-search="">
|
||||
<option value="" >请选择</option>
|
||||
{volist name='area' id='vo'}
|
||||
<option value="{$vo.id}" >{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">姓名<font>*</font></td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="name" lay-verify="required" lay-reqText="请输入负责人姓名"
|
||||
autocomplete="off" placeholder="请输入负责人姓名" class="layui-input">
|
||||
</td>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">负责人头像</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传缩略图(尺寸:640x360)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">职务<font>*</font></td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="duty" lay-verify="required" lay-reqText="请输入负责人职务"
|
||||
autocomplete="off" placeholder="请输入负责人职务" class="layui-input">
|
||||
</td>
|
||||
<td class="layui-td-gray">电话<font>*</td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="phone" lay-verify="required" lay-reqText="请输入负责人电话"
|
||||
autocomplete="off" placeholder="请输入负责人电话" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
|
||||
<script>
|
||||
const editorType = '{$editor}';
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, laydate = layui.laydate;
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
|
||||
//上传缩略图
|
||||
var upload_thumb = layui.upload.render({
|
||||
elem: '#upload_btn_thumb',
|
||||
url: '/admin/api/upload',
|
||||
done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
return layer.msg('上传失败');
|
||||
}
|
||||
//上传成功
|
||||
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||
}
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.lng = $('.lng').text();
|
||||
data.field.lat = $('.lat').text();
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
setTimeout(function () {
|
||||
parent.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
tool.post('/admin/nk.areamanager/add', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
//日期选择
|
||||
laydate.render({
|
||||
elem: '#formDate',
|
||||
max: 7,
|
||||
showBottom: false
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
280
app/admin/view/supplychain/merchant/bill.html
Normal file
280
app/admin/view/supplychain/merchant/bill.html
Normal file
@ -0,0 +1,280 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入商户名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[4])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if} -->
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[5]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'order_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
fixed: 'left',
|
||||
field: 'order_sn',
|
||||
title: '订单号',
|
||||
align: 'center',
|
||||
width:200,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '商户',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
return d.merchant.mer_name;
|
||||
},
|
||||
width:120,
|
||||
},{
|
||||
field: 'cart_id',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var cart = d.cart_id;
|
||||
var html = '';
|
||||
|
||||
for (let index = 0; index < cart.length; index++) {
|
||||
const element = cart[index];
|
||||
html+= element.product.store_name;
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
width:120,
|
||||
},{
|
||||
field: 'total_num',
|
||||
title: '商品数量',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'total_price',
|
||||
title: '订单金额',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'pay_price',
|
||||
title: '支付金额',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'uid',
|
||||
title: '用户',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.uid;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'paid',
|
||||
title: '支付状态',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
switch (d.paid) {
|
||||
case 0:
|
||||
var html = '未支付';
|
||||
break;
|
||||
case 1:
|
||||
var html = '已支付';
|
||||
break;
|
||||
}
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'delivery_type',
|
||||
title: '物品类型',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
switch (d.delivery_type) {
|
||||
case 1:
|
||||
var html = '发货';
|
||||
break;
|
||||
case 2:
|
||||
var html = '送货';
|
||||
break;
|
||||
case 3:
|
||||
var html = '虚拟';
|
||||
break;
|
||||
default:
|
||||
var html = '待定';
|
||||
break;
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'pay_type',
|
||||
title: '支付方式',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
switch (d.pay_type) {
|
||||
case 0:
|
||||
var html = '余额';
|
||||
break;
|
||||
case 1:
|
||||
var html = '微信';
|
||||
break;
|
||||
case 2:
|
||||
var html = '小程序';
|
||||
break;
|
||||
case 3:
|
||||
var html = 'h5';
|
||||
break;
|
||||
case 4:
|
||||
var html = '支付宝';
|
||||
break;
|
||||
case 5:
|
||||
var html = '支付宝扫码';
|
||||
break;
|
||||
case 6:
|
||||
var html = '微信扫码';
|
||||
break;
|
||||
default:
|
||||
var html = '未知的支付方式';
|
||||
break;
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'mark',
|
||||
title: '备注',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'verify_time',
|
||||
title: '核销时间',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'pay_time',
|
||||
title: '支付时间',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '下单时间',
|
||||
align: 'center',
|
||||
width:150,
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[4]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
133
app/admin/view/supplychain/merchant/edit.html
Normal file
133
app/admin/view/supplychain/merchant/edit.html
Normal file
@ -0,0 +1,133 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">所属区域<font>*</font></td>
|
||||
<td colspan="12">
|
||||
<div class="layui-col-md12">
|
||||
<select name="area_id" lay-verify="required" lay-search="">
|
||||
<option value="" >请选择</option>
|
||||
{volist name='area' id='vo'}
|
||||
{if $detail.area_id == $vo.id}
|
||||
<option value="{$vo.id}" selected>{$vo.area_name}</option>
|
||||
{else/}
|
||||
<option value="{$vo.id}">{$vo.area_name}</option>
|
||||
{/if}
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">姓名<font>*</font></td>
|
||||
<td colspan="7">
|
||||
<input type="text" name="name" lay-verify="required" lay-reqText="请输入负责人姓名"
|
||||
autocomplete="off" placeholder="请输入负责人姓名" class="layui-input" value="{$detail.name}">
|
||||
</td>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">负责人头像</td>
|
||||
<td>
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传缩略图(尺寸:640x360)</button>
|
||||
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
|
||||
<img src="{$detail.avatar}" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
|
||||
<input type="hidden" name="avatar" value="{$detail.avatar}">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">职务<font>*</font></td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="duty" lay-verify="required" lay-reqText="请输入负责人职务"
|
||||
autocomplete="off" placeholder="请输入负责人职务" class="layui-input" value="{$detail.duty}">
|
||||
</td>
|
||||
<td class="layui-td-gray">电话<font>*</td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="phone" lay-verify="required" lay-reqText="请输入负责人电话"
|
||||
autocomplete="off" placeholder="请输入负责人电话" class="layui-input" value="{$detail.phone}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
|
||||
var editor = layui.tinymce;
|
||||
var lat = "{$detail.lat}";
|
||||
var lng = "{$detail.lng}";
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
//上传缩略图
|
||||
var upload_thumb = layui.upload.render({
|
||||
elem: '#upload_btn_thumb',
|
||||
url: '/admin/api/upload',
|
||||
done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
layer.msg('上传失败');
|
||||
return false;
|
||||
}
|
||||
//上传成功
|
||||
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||
}
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/nk.areamanager/edit", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
//日期选择
|
||||
laydate.render({
|
||||
elem: '#formDate',
|
||||
max: 17,
|
||||
showBottom: false
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
259
app/admin/view/supplychain/merchant/index.html
Normal file
259
app/admin/view/supplychain/merchant/index.html
Normal file
@ -0,0 +1,259 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入商户名称" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[4])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if} -->
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[4]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
fixed: 'left',
|
||||
field: 'supplyChain',
|
||||
title: '供应链',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.supplyChain.name;
|
||||
return html;
|
||||
},
|
||||
width:120,
|
||||
},{
|
||||
field: 'brokerage',
|
||||
title: '团队负责人',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.principal ? '是': '否';
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '商户',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.mer_name;
|
||||
return html;
|
||||
},
|
||||
width:120,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.real_name;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '联系电话',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.mer_phone;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '店铺状态',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = '<span style="color:#fbbc05">锁定</span>';
|
||||
if (d.merchant.status == 1) {
|
||||
html = '<span style="color:#12bb37">正常</span>';
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '产品数量',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.mer_phone;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '产品数量',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.mer_phone;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '余额',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.mer_money;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '保证金',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.margin;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'order_number',
|
||||
title: '销量',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.sales;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '商户地址',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.mer_address;
|
||||
return html;
|
||||
},
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'merchant',
|
||||
title: '入驻时间',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.merchant.create_time;
|
||||
return html;
|
||||
},
|
||||
width:150,
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[4]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete('{$url[3]}', { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
67
app/admin/view/supplychain/merchant/read.html
Normal file
67
app/admin/view/supplychain/merchant/read.html
Normal file
@ -0,0 +1,67 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style>
|
||||
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||
.layui-td-gray{
|
||||
width: 110px;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">标题<font>*</font></td>
|
||||
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入标题"
|
||||
autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}" readonly></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">简介<font>*</font></td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="synopsis" readonly>{$detail.synopsis}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">内容</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="content" readonly>{$detail.content}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">坐标</td>
|
||||
<td colspan="6">
|
||||
<p>经度:{$detail.lng}</p>
|
||||
<p>纬度:{$detail.lat}</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">运输距离</td>
|
||||
<td colspan="6">
|
||||
{volist name='farmers' id='vo'}
|
||||
<p>距离 {$vo.title} {$vo.juli} 公里</p>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
Loading…
x
Reference in New Issue
Block a user