更新:冲突解决
commit
d59231b888
|
@ -0,0 +1,270 @@
|
|||
<?php
|
||||
|
||||
namespace app\controller\manager;
|
||||
|
||||
use app\model\Business as BusinessModel;
|
||||
use app\model\Log;
|
||||
use app\model\Member;
|
||||
use app\model\Member as MemberModel;
|
||||
use app\repository\BusinessRepository;
|
||||
use Exception;
|
||||
use tauthz\facade\Enforcer;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\response\Json;
|
||||
use think\response\Redirect;
|
||||
use think\response\View;
|
||||
|
||||
//工作人员
|
||||
class Agency extends Base
|
||||
{
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws Exception
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$item = input('post.');
|
||||
|
||||
$validate = $this->validateByApi($item, [
|
||||
'username|用户名' => 'require|alphaDash|min:4|max:16|unique:member',
|
||||
'mobile|手机号' => 'require|unique:member',
|
||||
'nickname|昵称' => 'require|chsAlphaNum|min:2|max:10',
|
||||
'password|密码' => 'require|min:4|max:16',
|
||||
'remark|备注信息' => 'max:255',
|
||||
]);
|
||||
|
||||
if ($validate !== true) {
|
||||
return $validate;
|
||||
}
|
||||
|
||||
if (!checkMobile($item['mobile'])) {
|
||||
return $this->json(4002, '请输入正确的手机号码');
|
||||
}
|
||||
|
||||
$item['roles'] = [Member::ANENT_ROLE_ID];
|
||||
$item['status'] = Member::COMMON_ON;
|
||||
|
||||
$roles = [];
|
||||
if ($item['roles']) {
|
||||
$roles = $item['roles'];
|
||||
$item['roles'] = implode(',', $item['roles']);
|
||||
}
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
//如果关联商家
|
||||
if (!empty($item['business_code'])) {
|
||||
$Business = BusinessRepository::getInstance()->findOneByWhere(["code" => $item['business_code']]);
|
||||
if (empty($Business)) {
|
||||
Db::rollback();
|
||||
return $this->json(4001, "指定商家不存在");
|
||||
}
|
||||
$Business->save(["is_agency" => BusinessModel::COMMON_ON]);
|
||||
}
|
||||
|
||||
|
||||
$item['password'] = md5($item['password'] . $item['username']);
|
||||
$member = MemberModel::create($item);
|
||||
foreach ($roles as $role) {
|
||||
Enforcer::addRoleForUser($member['id'], $role);
|
||||
}
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
} catch (ValidateException $e) {
|
||||
Db::rollback();
|
||||
return $this->json(4001, $e->getError());
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['roleJson'] = $this->roleJson();
|
||||
$this->data['business'] = BusinessRepository::getInstance()->getBusinessAll();
|
||||
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = input('id/d', 0);
|
||||
|
||||
if (!$info = MemberModel::findById($id)) {
|
||||
return $this->json(4001, '记录不存在');
|
||||
}
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$item = input('post.');
|
||||
|
||||
$validate = $this->validateByApi($item, [
|
||||
'mobile|手机号' => 'require|unique:member,mobile,' . $id,
|
||||
'nickname|昵称' => 'require|chsAlphaNum|min:2|max:10',
|
||||
'remark|备注信息' => 'max:255',
|
||||
]);
|
||||
|
||||
if ($validate !== true) {
|
||||
return $validate;
|
||||
}
|
||||
|
||||
if (!checkMobile($item['mobile'])) {
|
||||
return $this->json(4002, '请输入正确的手机号码');
|
||||
}
|
||||
$item['roles'] = [Member::ANENT_ROLE_ID];
|
||||
$roles = [];
|
||||
if ($item['roles']) {
|
||||
$roles = $item['roles'];
|
||||
$item['roles'] = implode(',', $item['roles']);
|
||||
}
|
||||
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
//之前关联的商家不为空 并且已经改变 吧之前的商家 从代理商变成普通商家
|
||||
if ($info['business_code'] != $item['business_code']) {
|
||||
if (!empty($info['business_code'])) {
|
||||
$oldBusiness = BusinessRepository::getInstance()->findOneByWhere(["code" => $info['business_code']]);
|
||||
if (!empty($oldBusiness)) {
|
||||
$oldBusiness->save(["is_agency" => BusinessModel::COMMON_OFF]);
|
||||
}
|
||||
}
|
||||
//如果改变了关联商家
|
||||
if (!empty($item['business_code'])) {
|
||||
$Business = BusinessRepository::getInstance()->findOneByWhere(["code" => $item['business_code']]);
|
||||
if (empty($Business)) {
|
||||
Db::rollback();
|
||||
return $this->json(4001, "指定商家不存在");
|
||||
}
|
||||
$Business->save(["is_agency" => BusinessModel::COMMON_ON]);
|
||||
}
|
||||
}
|
||||
|
||||
$info->save($item);
|
||||
//删除所有角色
|
||||
Enforcer::deleteRolesForUser($id);
|
||||
//新增角色
|
||||
foreach ($roles as $role) {
|
||||
Enforcer::addRoleForUser($id, $role);
|
||||
}
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
} catch (ValidateException $e) {
|
||||
Db::rollback();
|
||||
return $this->json(4001, $e->getError());
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['item'] = $info;
|
||||
$this->data['roleJson'] = $this->roleJson(explode(',', $info['roles']));
|
||||
|
||||
$this->data['business'] = BusinessRepository::getInstance()->getBusinessAll();
|
||||
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 轮播图列表
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws Exception
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$page = $this->request->param('page/d', 1);
|
||||
$size = $this->request->param('size/d', 30);
|
||||
|
||||
//只查询拥有渠道商的账号
|
||||
$whereMap = [['roles', "=", Member::ANENT_ROLE_ID], ['id', "<>", 1]];
|
||||
$orders = ['id' => 'asc'];
|
||||
|
||||
$list = Member::findList($whereMap, [], $page, $size, null, $orders);
|
||||
|
||||
return $this->json(0, 'success', $list);
|
||||
}
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @return Json
|
||||
*/
|
||||
public function del(): Json
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$ids = input('post.ids/a', []);
|
||||
if (empty($ids)) {
|
||||
$ids[] = input('post.id/d');
|
||||
}
|
||||
MemberModel::deleteByIds($ids);
|
||||
foreach ($ids as $id) {
|
||||
Enforcer::deleteRolesForUser($id);
|
||||
}
|
||||
Log::write(get_class() . 'Del', 'del', '涉及到的ID为:' . implode(',', $ids));
|
||||
return $this->json();
|
||||
}
|
||||
return $this->json(4001, '非法请求!');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @return Json|View|Redirect
|
||||
* @throws Exception
|
||||
*/
|
||||
public function password()
|
||||
{
|
||||
$id = input('id/d', 0);
|
||||
|
||||
if (!$item = MemberModel::findById($id)) {
|
||||
if ($this->request->isAjax()) {
|
||||
return $this->json(4001, '记录不存在');
|
||||
}
|
||||
return $this->error('记录不存在');
|
||||
}
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$post = input('post.');
|
||||
$validate = $this->validateByApi($post, [
|
||||
'password|密码' => 'require|confirm',
|
||||
]);
|
||||
|
||||
if ($validate !== true) {
|
||||
return $validate;
|
||||
}
|
||||
|
||||
$password = md5($post['password'] . $item['username']);
|
||||
|
||||
try {
|
||||
$item->save(['password' => $password]);
|
||||
return $this->json();
|
||||
} catch (ValidateException $e) {
|
||||
return $this->json(4001, $e->getError());
|
||||
}
|
||||
}
|
||||
|
||||
$this->data['item'] = $item;
|
||||
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\controller\manager;
|
||||
|
||||
|
||||
/*流水查看*/
|
||||
|
||||
use app\repository\BillRepository;
|
||||
|
||||
class Bill extends Base
|
||||
{
|
||||
/**
|
||||
* 流水列表
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws Exception
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$repo = BillRepository::getInstance();
|
||||
$keyword = $this->request->param('keyword/s', '');
|
||||
$page = $this->request->param('page/d', 1);
|
||||
$size = $this->request->param('size/d', 30);
|
||||
$orders = ['sort'=>'asc'];
|
||||
|
||||
|
||||
$list = $repo->billList($keyword, $page, $size, $orders);
|
||||
|
||||
return $this->json(0, 'success', $list);
|
||||
}
|
||||
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -234,6 +234,7 @@ class Business extends Base
|
|||
if ($this->request->isPost()) {
|
||||
$businessCode = input("business_code/s", "");
|
||||
$state = input("state/d", 0);
|
||||
$reason = input("reason/s", '');
|
||||
$business = BusinessRepository::getInstance()->findOneByWhere(["code" => $businessCode]);
|
||||
if (empty($business)) {
|
||||
return $this->json(4001, "商家不存在");
|
||||
|
@ -246,15 +247,15 @@ class Business extends Base
|
|||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
$business->save(["state"=>$state]);
|
||||
$business->save(["state" => $state, "reason" => $reason]);
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
}catch (RepositoryException $e){
|
||||
return $this->json();
|
||||
} catch (RepositoryException $e) {
|
||||
Db::rollback();
|
||||
return $this->json("5001","审核失败");
|
||||
}catch (\think\Exception $e){
|
||||
return $this->json("5001", "审核失败");
|
||||
} catch (\think\Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->json("5002","审核失败");
|
||||
return $this->json("5002", "审核失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -272,24 +273,24 @@ class Business extends Base
|
|||
|
||||
if ($this->request->isPost()) {
|
||||
$anent_code = input("agency_code/s", "");
|
||||
if(empty($business)){
|
||||
return $this->json(4001,"商家不存在");
|
||||
if (empty($business)) {
|
||||
return $this->json(4001, "商家不存在");
|
||||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
$business->save(["agency_code"=>$anent_code]);
|
||||
$business->save(["agency_code" => $anent_code]);
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
}catch (RepositoryException $e){
|
||||
return $this->json();
|
||||
} catch (RepositoryException $e) {
|
||||
Db::rollback();
|
||||
return $this->json("5001","指派失败");
|
||||
}catch (\think\Exception $e){
|
||||
return $this->json("5001", "指派失败");
|
||||
} catch (\think\Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->json("5002","指派失败");
|
||||
return $this->json("5002", "指派失败");
|
||||
}
|
||||
}
|
||||
if(empty($business)){
|
||||
return $this->error("商家不存在");
|
||||
if (empty($business)) {
|
||||
return $this->error("商家不存在");
|
||||
}
|
||||
$this->data["agent"] = Member::getAgentAll();
|
||||
$this->data["businessCode"] = $businessCode;
|
||||
|
@ -308,47 +309,47 @@ class Business extends Base
|
|||
$business = BusinessRepository::getInstance()->findOneByWhere(["code" => $businessCode]);
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$money = input("money/f", 0,"abs");
|
||||
if($money<=0){
|
||||
return $this->json(4001,"金额错误");
|
||||
$money = input("money/f", 0, "abs");
|
||||
if ($money <= 0) {
|
||||
return $this->json(4001, "金额错误");
|
||||
}
|
||||
$money = floor($money * 100) / 100;
|
||||
if(empty($business)){
|
||||
return $this->json(4001,"商家不存在");
|
||||
if (empty($business)) {
|
||||
return $this->json(4001, "商家不存在");
|
||||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
//创建充值订单
|
||||
if (!$order = RechargeRepository::getInstance()->createOrder($businessCode,$money)) {
|
||||
if (!$order = RechargeRepository::getInstance()->createOrder($businessCode, $money)) {
|
||||
throw new RepositoryException('订单创建失败,请稍后重试');
|
||||
}
|
||||
//生成支付
|
||||
$res = WechatPay::getInstance()->order->unify([
|
||||
'body' => '商家充值',
|
||||
'body' => '商家充值',
|
||||
'out_trade_no' => $order->order_num,
|
||||
'total_fee' => $money * 100,
|
||||
'trade_type' => 'NATIVE',
|
||||
'product_id' => $order->id,
|
||||
'notify_url' => $this->request->domain()."/api/recharge/notify.html",
|
||||
'total_fee' => $money * 100,
|
||||
'trade_type' => 'NATIVE',
|
||||
'product_id' => $order->id,
|
||||
'notify_url' => $this->request->domain() . "/api/recharge/notify.html",
|
||||
]);
|
||||
|
||||
if(!isset($res['code_url'])){
|
||||
if (!isset($res['code_url'])) {
|
||||
throw new RepositoryException('订单创建失败,请稍后重试');
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
return $this->json(0,"success",["order_num"=>$order->order_num,"code_url"=>$res['code_url']]);
|
||||
}catch (RepositoryException $e){
|
||||
return $this->json(0, "success", ["order_num" => $order->order_num, "code_url" => $res['code_url']]);
|
||||
} catch (RepositoryException $e) {
|
||||
Db::rollback();
|
||||
return $this->json("5001",$e->getMessage());
|
||||
}catch (Exception $e){
|
||||
return $this->json("5001", $e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->json("5001",$e->getMessage());
|
||||
return $this->json("5001", $e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
if(empty($business)){
|
||||
return $this->error("商家不存在");
|
||||
if (empty($business)) {
|
||||
return $this->error("商家不存在");
|
||||
}
|
||||
|
||||
$this->data["businessCode"] = $businessCode;
|
||||
|
|
|
@ -182,4 +182,32 @@ class Config extends Base
|
|||
return $this->view('manager/config/'.$name);
|
||||
}
|
||||
}
|
||||
|
||||
/* 分配比例*/
|
||||
public function distributionProportion(){
|
||||
if ($this->request->isPost()) {
|
||||
$data = input("post.");
|
||||
unset($data['_token']);
|
||||
$validate = $this->validateByApi($data, [
|
||||
'agency' => 'require|number',
|
||||
'admin' => 'require|number',
|
||||
'consumer' => 'require|number',
|
||||
]);
|
||||
|
||||
if ($validate !== true) {
|
||||
return $validate;
|
||||
}
|
||||
$total = $data['agency'] + $data['admin'] + $data['consumer'];
|
||||
if ($total != 100) {
|
||||
return $this->json(5002,"分配比例总和不等于100");
|
||||
}
|
||||
$php = var_export($data, true);
|
||||
file_put_contents($this->extraPath . 'distribution_proportion.php', '<?php' . PHP_EOL . 'return ' . $php . ';');
|
||||
return $this->json();
|
||||
} else {
|
||||
CConfig::load('extra/distribution_proportion', 'distributionProportion');
|
||||
$this->data['item'] = config('distributionProportion');
|
||||
return $this->view();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,11 +5,14 @@ namespace app\controller\manager;
|
|||
use app\exception\RepositoryException;
|
||||
|
||||
use app\model\CouponMain;
|
||||
use app\repository\BusinessRepository;
|
||||
use app\repository\CouponRepository;
|
||||
use app\validate\CouponRelease;
|
||||
use Exception;
|
||||
use think\facade\Db;
|
||||
use think\response\Json;
|
||||
use think\response\View;
|
||||
use think\facade\Config as CConfig;
|
||||
|
||||
/**
|
||||
* 优惠券相关
|
||||
|
@ -17,6 +20,13 @@ use think\response\View;
|
|||
class Coupon extends Base
|
||||
{
|
||||
|
||||
protected function initialize()
|
||||
{
|
||||
parent::initialize(); // TODO: Change the autogenerated stub
|
||||
CConfig::load('extra/distribution_proportion', 'distributionProportion');
|
||||
$this->data['distributionProportion'] = config('distributionProportion');
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
|
@ -90,10 +100,198 @@ class Coupon extends Base
|
|||
return $this->json(4001, "优惠券不存在");
|
||||
}
|
||||
|
||||
if (in_array($on_shelf, [CouponMain::COMMON_OFF, CouponMain::COMMON_ON])) {
|
||||
if (!in_array($on_shelf, [CouponMain::COMMON_OFF, CouponMain::COMMON_ON])) {
|
||||
return $this->json(4001, "状态错误");
|
||||
}
|
||||
$coupon->save(["on_shelf"=>$on_shelf]);
|
||||
$coupon->save(["on_shelf" => $on_shelf]);
|
||||
return $this->json();
|
||||
}
|
||||
|
||||
/**
|
||||
* 持有详细
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws Exception
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$model = new CouponMain();
|
||||
$repo = CouponRepository::getInstance($model);
|
||||
$id = input("id/d");
|
||||
$keyword = $this->request->param('keyword/s', '');
|
||||
$page = $this->request->param('page/d', 1);
|
||||
$size = $this->request->param('size/d', 30);
|
||||
|
||||
$list = $repo->couponMainHasList($id, $keyword, $page, $size);
|
||||
$time = time();
|
||||
$list["list"]->each(function ($item) use ($time) {
|
||||
if (strtotime($item['end_time']) < $time) {
|
||||
$item->time_state = '已过期';
|
||||
} else {
|
||||
$item->time_state = '未过期';
|
||||
}
|
||||
|
||||
});
|
||||
return $this->json(0, 'success', $list);
|
||||
}
|
||||
$id = input("id/d");
|
||||
$model = new CouponMain();
|
||||
$repo = CouponRepository::getInstance($model);
|
||||
$coupon = $repo->getModel()->with(["business" => function ($query) {
|
||||
$query
|
||||
->field("code,business_name,business_subtitle,type")
|
||||
->with('category');
|
||||
}, "couponType"])->where("id", $id)->find();
|
||||
if (empty($coupon)) {
|
||||
return $this->error("优惠券不存在");
|
||||
}
|
||||
$this->data["coupon"] = $coupon;
|
||||
return $this->view();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布优惠券
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
public function release()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$data = input("item/a", []);
|
||||
$validate = new CouponRelease();
|
||||
if (!$validate->check($data)) {
|
||||
return $this->json(4001, $validate->getError());
|
||||
}
|
||||
$business = BusinessRepository::getInstance()->getBusinessAccount($data["business_code"], true);
|
||||
|
||||
if (empty($business)) {
|
||||
return $this->json(4001, '商家不存在');
|
||||
}
|
||||
$data['business_type'] = $business->business['type'];
|
||||
$data['business_name'] = $business->business['business_name'];
|
||||
$data['lng'] = $business->business['lng'];
|
||||
$data['lat'] = $business->business['lat'];
|
||||
|
||||
|
||||
$type = CouponRepository::getInstance()->getCouponTypeAll();
|
||||
$type = array_column($type->toArray(), null, "id");
|
||||
if (!isset($type[$data['type']])) {
|
||||
return $this->json(4001, '优惠券类型不存在');
|
||||
}
|
||||
$data['commission_agency'] = input("item.commission_agency/d", 0);
|
||||
$data['commission_admin'] = input("item.commission_admin/d", 0);
|
||||
$data['commission_consumer'] = input("item.commission_consumer/d", 0);
|
||||
|
||||
$totalC = $data['commission_agency'] + $data['commission_admin'] + $data['commission_consumer'];
|
||||
if ($totalC != 100) {
|
||||
return $this->json(5002, "分配比例总和不等于100");
|
||||
}
|
||||
|
||||
//保留两位小数
|
||||
$data['money'] = floor($data['money'] * 100) / 100;
|
||||
|
||||
$totalMoney = $data['money'] * $data['count'];
|
||||
if ($business->business["balance"] < $totalMoney) {
|
||||
return $this->json(4001, '商家余额不足');
|
||||
}
|
||||
|
||||
$data['type_name'] = $type[$data['type']]['name'];
|
||||
$date = date("Y-m-d H:i:s");
|
||||
$data['create_time'] = $date;
|
||||
$data['update_time'] = $date;
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
CouponRepository::getInstance()->releaseCouponMain($data, $totalMoney);
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
} catch (RepositoryException $e) {
|
||||
Db::rollback();
|
||||
return $this->json(5001, "发布失败" . $e->getMessage());
|
||||
} catch (\think\Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->json(5002, "发布失败" . $e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->data['business'] = BusinessRepository::getInstance()->getBusinessAll();
|
||||
$this->data['type'] = CouponRepository::getInstance()->getCouponTypeAll();
|
||||
return $this->view('add');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @return Json|View
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$couponMain = CouponMain::findById(input("id/d", 0));
|
||||
if ($this->request->isPost()) {
|
||||
$data = input("item/a", []);
|
||||
|
||||
if (empty($couponMain)) {
|
||||
return $this->json(4001, "优惠券不存在");
|
||||
}
|
||||
$validate = new CouponRelease();
|
||||
if (!$validate->scene("edit")->check($data)) {
|
||||
return $this->json(4001, $validate->getError());
|
||||
}
|
||||
$business = BusinessRepository::getInstance()->getBusinessAccount($data["business_code"], true);
|
||||
|
||||
if (empty($business)) {
|
||||
return $this->json(4001, '商家不存在');
|
||||
}
|
||||
//更新经纬度
|
||||
$data['business_type'] = $business->business['type'];
|
||||
$data['business_name'] = $business->business['business_name'];
|
||||
$data['lng'] = $business->business['lng'];
|
||||
$data['lat'] = $business->business['lat'];
|
||||
|
||||
|
||||
$data['commission_agency'] = input("item.commission_agency/d", 0);
|
||||
$data['commission_admin'] = input("item.commission_admin/d", 0);
|
||||
$data['commission_consumer'] = input("item.commission_consumer/d", 0);
|
||||
$totalC = $data['commission_agency'] + $data['commission_admin'] + $data['commission_consumer'];
|
||||
if ($totalC != 100) {
|
||||
return $this->json(5002, "分配比例总和不等于100");
|
||||
}
|
||||
|
||||
$data['update_time'] = date("Y-m-d H:i:s");
|
||||
|
||||
Db::startTrans();
|
||||
try {
|
||||
$couponMain->save($data);
|
||||
Db::commit();
|
||||
return $this->json();
|
||||
} catch (RepositoryException $e) {
|
||||
Db::rollback();
|
||||
return $this->json(5001, "发布失败" . $e->getMessage());
|
||||
} catch (\think\Exception $e) {
|
||||
Db::rollback();
|
||||
return $this->json(5002, "发布失败" . $e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($couponMain)) {
|
||||
return $this->error("优惠券不存在");
|
||||
}
|
||||
$this->data['business'] = BusinessRepository::getInstance()->getBusinessAll();
|
||||
$this->data['type'] = CouponRepository::getInstance()->getCouponTypeAll();
|
||||
$this->data['item'] = $couponMain;
|
||||
|
||||
return $this->view();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -46,7 +46,6 @@ class Login extends BaseController
|
|||
'user_id' => $member['id'],
|
||||
'username' => $member['username'],
|
||||
'nickname' => $member['nickname'],
|
||||
'account_id' => $member['account_id'],//绑定的前台用户ID
|
||||
];
|
||||
|
||||
$jwtToken = Jwt::generate($userInfo, env('app.expire', 7200));
|
||||
|
|
|
@ -23,4 +23,13 @@ class Coupon extends Base
|
|||
{
|
||||
return $this->hasOne(CouponBill::class,"coupon_id","id");
|
||||
}
|
||||
public function account()
|
||||
{
|
||||
return $this->hasOne(Account::class,"user_code","consumer_code");
|
||||
}
|
||||
|
||||
public function business()
|
||||
{
|
||||
return $this->hasOne(Business::class,"code","business_code");
|
||||
}
|
||||
}
|
|
@ -23,4 +23,8 @@ class CouponMain extends Base
|
|||
{
|
||||
return $this->hasOne(Business::class, 'code',"business_code");
|
||||
}
|
||||
public function couponType()
|
||||
{
|
||||
return $this->hasOne(CouponType::class, 'id',"type_id");
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ class Member extends Base
|
|||
public const STATUS_NORMAL = 1;//正常
|
||||
public const STATUS_DISABLE = 0;//禁用
|
||||
|
||||
public const ANENT_role_id = 2;//角色id 2 为代理商
|
||||
public const ANENT_ROLE_ID = 2;//角色id 2 为代理商
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ class Member extends Base
|
|||
|
||||
$subQuery = Db::name('member')
|
||||
->field('id,business_code,nickname')
|
||||
->whereRaw('(find_in_set("'.Member::ANENT_role_id.'", roles))')
|
||||
->whereRaw('(find_in_set("'.Member::ANENT_ROLE_ID .'", roles))')
|
||||
->buildSql();
|
||||
|
||||
return Db::table($subQuery . ' a')
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace app\repository;
|
||||
|
||||
use app\exception\RepositoryException;
|
||||
use app\model\Business;
|
||||
use app\model\BusinessFlow;
|
||||
use app\model\CouponBill;
|
||||
use app\model\CouponMain;
|
||||
use app\model\Deduction;
|
||||
use app\model\Recharge;
|
||||
use app\service\Repository;
|
||||
use think\Collection;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 流水相关
|
||||
*
|
||||
* Class BusinessRepository
|
||||
* @package app\repository
|
||||
* @method self getInstance(Model $model = null) static
|
||||
*/
|
||||
class BillRepository extends Repository
|
||||
|
||||
{
|
||||
/**
|
||||
* 流水列表
|
||||
* @param $keyword
|
||||
* @param $page
|
||||
* @param $size
|
||||
* @param $orders
|
||||
*/
|
||||
public function billList($keyword, $page, $size, $orders = ["a.id" => "desc"])
|
||||
{
|
||||
$failData = [
|
||||
'total' => 0,
|
||||
'current' => $page,
|
||||
'size' => $size,
|
||||
'list' => new Collection(),
|
||||
];
|
||||
$rep = CouponBill::alias("a")
|
||||
->join("business b", "a.business_code = b.code")
|
||||
->wher(!empty($keyword), function ($q) use ($keyword) {
|
||||
$q->where("b.business_name", "like", "%$keyword%");
|
||||
});
|
||||
|
||||
$failData ['total'] = $rep->count();
|
||||
$failData ['list'] = $rep->field("a.*,b.business_name")
|
||||
->page($page, $size)
|
||||
->order($orders)
|
||||
->select();
|
||||
return $failData;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ namespace app\repository;
|
|||
|
||||
use app\exception\RepositoryException;
|
||||
use app\model\Business;
|
||||
use app\model\BusinessFlow;
|
||||
use app\model\CouponMain;
|
||||
use app\model\Deduction;
|
||||
use app\model\Recharge;
|
||||
|
@ -104,12 +105,34 @@ class BusinessRepository extends Repository
|
|||
*/
|
||||
public function businessRechargeList($where, int $page = 1, int $limit = 0, array $order = ["create_time" => "desc", "id" => "desc"])
|
||||
{
|
||||
return Recharge::findList($where, [], $page, $limit, function ($q){
|
||||
return $q->withJoin(["business"=>["business_name"]]);
|
||||
return Recharge::findList($where, [], $page, $limit, function ($q) {
|
||||
return $q->withJoin(["business" => ["business_name"]]);
|
||||
}, $order);
|
||||
}
|
||||
/* 获取所有不是代理商的商家*/
|
||||
public function getBusinessAll(){
|
||||
return Business:: where("state", Business::state_on)->select();
|
||||
|
||||
/* 获取所有的商家*/
|
||||
public function getBusinessAll()
|
||||
{
|
||||
return Business:: where("state", Business::state_on)->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个商家详情
|
||||
* @param $businessCode
|
||||
* @param bool $lock
|
||||
* @return BusinessFlow|array|Model|null
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getBusinessAccount($businessCode,bool $lock = false)
|
||||
{
|
||||
$Flow = BusinessFlow::with(["account", "business"])->where("business_code", $businessCode)->when($lock,function ($q){
|
||||
$q->lock(true);
|
||||
})->find();
|
||||
if (empty($Flow) || empty($Flow->account) || empty($Flow->business)) {
|
||||
return null;
|
||||
}
|
||||
return $Flow;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace app\repository;
|
||||
|
||||
use app\exception\RepositoryException;
|
||||
use app\model\Business;
|
||||
use app\model\Coupon;
|
||||
use app\model\CouponMain;
|
||||
use app\model\CouponType;
|
||||
use app\service\Repository;
|
||||
use Exception;
|
||||
use think\Db;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
|
@ -18,16 +21,57 @@ use think\Model;
|
|||
class CouponRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* 优惠券列表
|
||||
* 优惠券持有信息列表
|
||||
*
|
||||
* @param string $businessCode 商家code
|
||||
* @param array $order
|
||||
* @param $id
|
||||
* @param $keyword
|
||||
* @param $page
|
||||
* @param $size
|
||||
* @return array
|
||||
* @throws RepositoryException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function businessCouponModel($where)
|
||||
public function couponMainHasList($id, $keyword, $page, $size)
|
||||
{
|
||||
return CouponMain::where($where);
|
||||
|
||||
return Coupon::findList(["id" => $id], [], $page, $size, function ($q) use ($keyword) {
|
||||
if (!empty($keyword)) {
|
||||
return $q::hasWhere('account', function ($q) use ($keyword) {
|
||||
$q->where('nick_name', 'like', "%" . $keyword . "%")->field("nick_name,avatar_url");
|
||||
});
|
||||
} else {
|
||||
return $q->with(["account" => function ($query) {
|
||||
$query->field("nick_name,avatar_url");
|
||||
}]);
|
||||
}
|
||||
}, ["id" => "desc"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券持有信息列表
|
||||
*
|
||||
* @param $id
|
||||
* @param $keyword
|
||||
* @param $page
|
||||
* @param $size
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
public function getCouponTypeAll()
|
||||
{
|
||||
|
||||
return CouponType::order(["id" => "desc"])->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布优惠券 扣除商家余额
|
||||
* @param $data
|
||||
* @param $totalMoney
|
||||
*/
|
||||
public function releaseCouponMain($data, $totalMoney)
|
||||
{
|
||||
CouponMain::create($data);
|
||||
Business::where("code", $data["business_code"])->dec("balance", $totalMoney)->update();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace app\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class CouponRelease extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'business_code|商家code' => 'require',
|
||||
//'lng|经度' => 'require',
|
||||
//'lat|纬度' => 'require',
|
||||
'count|总数' => 'require|number|>:0',
|
||||
'type|优惠券类型' => 'require',
|
||||
'start_time|开始时间' => 'require|date',
|
||||
'end_time|结束时间' => 'require|date|checkEndTime',
|
||||
'name|优惠券名称' => 'require|length:3,32',
|
||||
'money|金额' => 'require|>:0|<:5000',
|
||||
// 'deduction_money|扣除金额' => 'require|>=:0|<:5000',
|
||||
//'image_url|预览图' => '',
|
||||
//'using_rule|使用规则' => '',
|
||||
//'punishing_rule|处罚规则' => '',
|
||||
//'using_count|使用中' => '',
|
||||
//'received_count|已领取的优惠券数量' => '',
|
||||
//'edition|发布的版本' => '',
|
||||
'status|状态' => 'require|in:1,0',
|
||||
'on_shelf|上架状态' => 'require|in:1,0',
|
||||
//'intro|详情' => '',
|
||||
];
|
||||
|
||||
|
||||
protected $scene = [
|
||||
'edit' => ['start_time', 'end_time', 'name',"status","on_shelf"],
|
||||
];
|
||||
|
||||
protected function checkEndTime($value, $rule, $data = [])
|
||||
{
|
||||
if (strtotime($value) <= strtotime($data['start_time'])) {
|
||||
return "结束时间不能小于等于开始时间";
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function () {
|
||||
let $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
layer = layui.layer,
|
||||
xmSelect = layui.xmSelect,
|
||||
miniTab = layui.miniTab;
|
||||
|
||||
/**** index begin ***/
|
||||
//index页面
|
||||
if ($('.location-index-page').length > 0) {
|
||||
miniTab.listen();
|
||||
|
||||
// 渲染表格
|
||||
let listUrl = $('#table-container').data('url');
|
||||
let insTb = table.render({
|
||||
elem: '#table-container',
|
||||
toolbar: '#toolbar-tpl',
|
||||
defaultToolbar: [null],
|
||||
url: listUrl,
|
||||
method: 'post',
|
||||
even: true,
|
||||
limits: [10,20,50,100,200,500,1000],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'size',
|
||||
},
|
||||
parseData: function (res) {
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.data.total, //解析数据长度
|
||||
"data": res.data.list //解析数据列表
|
||||
};
|
||||
},
|
||||
page: true,
|
||||
cols: [[
|
||||
{type: 'checkbox'},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'nickname', minWidth: 200, title: '昵称'},
|
||||
{field: 'username', minWidth: 200, title: '用户名'},
|
||||
{field: 'mobile', minWidth: 200, title: '手机号'},
|
||||
{templet: '#row-status', minWidth: 200, title: '状态'},
|
||||
|
||||
{templet: '#row-operate', minWidth: 150, field: 'right', align: 'center', title: '操作', fixed: 'right'}
|
||||
]],
|
||||
done: function () {
|
||||
Tools.setInsTb(insTb);
|
||||
}
|
||||
});
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
//执行搜索重载
|
||||
table.reload('table-container', {
|
||||
page: {curr: 1}
|
||||
, where: data.field
|
||||
}, 'data');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/** td edit **/
|
||||
|
||||
table.on('edit(table-container)', function (obj) {
|
||||
let id = obj.data.id;
|
||||
if (obj.field == 'sort') {
|
||||
$.ajax('/manager/slide/sort', {
|
||||
data: {
|
||||
"sort": obj.value,
|
||||
"id": id
|
||||
}
|
||||
,dataType : 'json'
|
||||
,type: 'POST'
|
||||
})
|
||||
.done(function () {
|
||||
insTb.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
/*** index end ***/
|
||||
|
||||
/** add and edit **/
|
||||
if ($('.location-operate-page').length > 0) {
|
||||
//监听提交
|
||||
form.on('submit(saveMember)', function (data) {
|
||||
let url = $(data.elem).data('url');
|
||||
$.post(url, data.field, function (res) {
|
||||
layer.msg(res.msg);
|
||||
if (res.code === 0) {
|
||||
//刷新父级列表
|
||||
parent.layui.$('[data-table-refresh]').trigger("click");
|
||||
setTimeout(function () {
|
||||
//关闭当前弹出层
|
||||
let iframeIndex = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(iframeIndex);
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
|
@ -0,0 +1,69 @@
|
|||
layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function () {
|
||||
let $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
layer = layui.layer,
|
||||
xmSelect = layui.xmSelect,
|
||||
miniTab = layui.miniTab;
|
||||
|
||||
/**** index begin ***/
|
||||
//index页面
|
||||
if ($('.location-index-page').length > 0) {
|
||||
miniTab.listen();
|
||||
|
||||
// 渲染表格
|
||||
let listUrl = $('#table-container').data('url');
|
||||
let insTb = table.render({
|
||||
elem: '#table-container',
|
||||
toolbar: '#toolbar-tpl',
|
||||
defaultToolbar: [{ //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
|
||||
title: '搜索'
|
||||
, layEvent: 'search'
|
||||
, icon: 'layui-icon-search'
|
||||
}],
|
||||
url: listUrl,
|
||||
method: 'post',
|
||||
even: true,
|
||||
limits: [10,20,50,100,200,500,1000],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'size',
|
||||
},
|
||||
parseData: function (res) {
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.data.total, //解析数据长度
|
||||
"data": res.data.list //解析数据列表
|
||||
};
|
||||
},
|
||||
page: true,
|
||||
cols: [[
|
||||
{type: 'checkbox'},
|
||||
{field: 'id', width: 80, title: 'ID'},
|
||||
{field: 'title', minWidth: 200, title: '标题'},
|
||||
|
||||
]],
|
||||
done: function () {
|
||||
Tools.setInsTb(insTb);
|
||||
}
|
||||
});
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
//执行搜索重载
|
||||
table.reload('table-container', {
|
||||
page: {curr: 1}
|
||||
, where: data.field
|
||||
}, 'data');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*** index end ***/
|
||||
|
||||
});
|
|
@ -85,12 +85,48 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
|||
let title = $(obj.tr.context).data('title');
|
||||
|
||||
if (layEvent === 'wait') {
|
||||
$.post(url, {}, function (res) {
|
||||
layer.msg(res.msg);
|
||||
if (res.code === 0) {
|
||||
insTb.reload();
|
||||
}
|
||||
})
|
||||
state= $($(this).context).data('state') ;
|
||||
|
||||
if(state == 1){
|
||||
$.post(url, {state:state}, function (res) {
|
||||
layer.msg(res.msg);
|
||||
if (res.code === 0) {
|
||||
insTb.reload();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
layer.open({
|
||||
id:1,
|
||||
type: 1,
|
||||
title:'驳回请求',
|
||||
skin:'layui-layer-rim',
|
||||
area:['450px', '250px'],
|
||||
|
||||
content: ' <div class="layui-form-item" style="margin-top: 20px"> ' +
|
||||
'<label class="layui-form-label">原因</label>' +
|
||||
' <div class="layui-inline"> ' +
|
||||
'<input type="text" name="reason" id="reason" class="layui-input" placeholder="请简述原因"> ' +
|
||||
'</div>'
|
||||
+'</div>'
|
||||
,
|
||||
btn:['保存','取消'],
|
||||
btn1: function (index,layero) {
|
||||
var reason =$("#reason").val() ;
|
||||
$.post(url, {state:state,reason:reason}, function (res) {
|
||||
layer.msg(res.msg);
|
||||
if (res.code === 0) {
|
||||
insTb.reload();
|
||||
}
|
||||
})
|
||||
layer.close(index);
|
||||
},
|
||||
btn2:function (index,layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -42,7 +42,6 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
|||
{templet: '#row-received_map', title: '领取位置'},
|
||||
{field: 'money', title: '金额'},
|
||||
{field: 'business_name', title: '商家名称'},
|
||||
{field: 'business_name', title: '商家名称'},
|
||||
{templet: '#row-sign_map', title: '签到位置'},
|
||||
{templet: '#row-state', title: '状态'},
|
||||
]],
|
||||
|
|
|
@ -92,9 +92,47 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect','laydate']
|
|||
elem: '#end_time'
|
||||
,type: 'date'
|
||||
});
|
||||
//监听工具条
|
||||
table.on('tool(table-container)', function (obj) {
|
||||
let data = obj.data;
|
||||
let layEvent = obj.event;
|
||||
let url = $($(this).context).data('href');
|
||||
let title = $($(this).context).data('title');
|
||||
let width = $($(this).context).data('width') ? $($(this).context).data('width') : '100%';
|
||||
let height = $($(this).context).data('height') ? $($(this).context).data('height') : '100%';
|
||||
let insTb = Tools.getInsTb();
|
||||
|
||||
if (layEvent === 'shelf') {
|
||||
$.post(url, null, function (res) {
|
||||
layer.msg(res.msg)
|
||||
if (res.code === 0) {
|
||||
insTb.reload();
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (layEvent === 'info') {
|
||||
openLayer(url, title, width, height);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*** index end ***/
|
||||
|
||||
if ($('.location-operate-page').length > 0){
|
||||
//日期时间选择器
|
||||
laydate.render({
|
||||
elem: '#start_time'
|
||||
,type: 'date'
|
||||
});
|
||||
//日期时间选择器
|
||||
laydate.render({
|
||||
elem: '#end_time'
|
||||
,type: 'date'
|
||||
});
|
||||
}
|
||||
|
||||
});
|
|
@ -37,14 +37,19 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
|||
cols: [[
|
||||
// {type: 'checkbox'},
|
||||
{field: 'id' , width: 80, title: 'ID'},
|
||||
{field: 'name', title: '名称'},
|
||||
{field: 'type_name', title: '优惠券类型'},
|
||||
{templet: '#row-received_map', title: '领取位置'},
|
||||
{field: 'money', title: '金额'},
|
||||
{field: 'business_name', title: '商家名称'},
|
||||
{field: 'business_name', title: '商家名称'},
|
||||
{templet: '#row-sign_map', title: '签到位置'},
|
||||
{templet: '#row-cover', title: '头像'},
|
||||
{templet:function(d){
|
||||
if(d.account!=undefined&&d.account){
|
||||
return d.account.nick_name;
|
||||
}
|
||||
return d.consumer_name;
|
||||
}, title: '昵称'},
|
||||
|
||||
{field: 'received_time', title: '领取时间'},
|
||||
|
||||
|
||||
{templet: '#row-state', title: '状态'},
|
||||
{field: 'verificate_time', title: '验证时间'},
|
||||
]],
|
||||
done: function () {
|
||||
Tools.setInsTb(insTb);
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">昵称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="nickname" lay-verify="required" lay-reqtext="昵称不能为空" placeholder="请输入昵称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">手机号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="mobile" lay-verify="required" lay-reqtext="手机号不能为空" placeholder="请输入手机号" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="username" lay-verify="required" lay-reqtext="用户名不能为空" placeholder="请输入用户名" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">密码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="password" name="password" lay-verify="required" lay-reqtext="密码不能为空" placeholder="请输入密码" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">备注信息</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="remark" class="layui-textarea" placeholder="请输入备注信息"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">关联商家</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="business_code" lay-search="" >
|
||||
<option value=""></option>
|
||||
{foreach $business as $bitem}
|
||||
<option value="{$bitem['code']}" >{$bitem['contact_name']}_{$bitem['business_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/agency/add" lay-submit lay-filter="saveMember">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="__MANAGER__/js/agency.js?v={:mt_rand()}"></script>
|
|
@ -0,0 +1,52 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" class="layui-input disabled" disabled value="{$item.username ?? ''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">昵称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="nickname" lay-verify="required" lay-reqtext="昵称不能为空" placeholder="请输入昵称" value="{$item.nickname ?? ''}" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">手机号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="mobile" lay-verify="required" lay-reqtext="手机号不能为空" placeholder="请输入手机号" value="{$item.mobile ?? ''}" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">备注信息</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="remark" class="layui-textarea" placeholder="请输入备注信息">{$item.remark ?? ''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">关联商家</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="business_code" lay-search="" >
|
||||
<option value=""></option>
|
||||
{foreach $business as $bitem}
|
||||
<option value="{$bitem['code']}" {if $bitem['code']==$item['business_code']} selected {/if} >{$bitem['contact_name']}_{$bitem['business_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/agency/edit?id={$item.id}" lay-submit lay-filter="saveMember">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="__MANAGER__/js/agency.js?v={:mt_rand()}"></script>
|
|
@ -0,0 +1,58 @@
|
|||
{layout name="manager/layout" /}
|
||||
<style>
|
||||
.layui-table-cell{
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
.layui-table .layui-layer-photos {height: 90px;}
|
||||
.layui-table img{
|
||||
max-height: 100%;
|
||||
object-fit: cover;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
max-width: 150px;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layui-row layui-col-space12">
|
||||
<div class="layui-col-xs12 layui-col-md12">
|
||||
<div id="echarts-records" style="background-color:#ffffff;min-height:600px;">
|
||||
<div class="layuimini-container location-index-page">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<div>
|
||||
<table id="table-container" class="layui-table" data-url="/manager/agency/index" lay-filter="table-container"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 操作列 -->
|
||||
<script type="text/html" id="row-status">
|
||||
{{# if (d.status==1){ }}
|
||||
正常
|
||||
{{# }else{ }}
|
||||
已禁用
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<!-- 操作列 -->
|
||||
<script type="text/html" id="row-operate">
|
||||
<a class="layui-btn layui-btn-warm layui-btn-xs" data-href="/manager/agency/password.html?id={{d.id}}" data-title="修改密码" lay-event="password">改密</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/agency/edit.html?id={{d.id}}" data-title="编辑" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" data-href="/manager/agency/del.html" lay-event="del">删除</a>
|
||||
</script>
|
||||
|
||||
<!-- toolbar -->
|
||||
<script type="text/html" id="toolbar-tpl">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" data-href="/manager/agency/add.html" data-title="添加轮播图" lay-event="add">添加</a>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script src="__MANAGER__/js/agency.js?v={:mt_rand()}"></script>
|
|
@ -0,0 +1,35 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" class="layui-input" disabled value="{$item.username ?? ''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">新密码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="password" name="password" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">确认密码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="password" name="password_confirm" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/agency/password?id={$item.id}" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="__MANAGER__/js/agency.js?v={:mt_rand()}"></script>
|
|
@ -0,0 +1,66 @@
|
|||
{layout name="manager/layout" /}
|
||||
<style>
|
||||
.layui-table-cell{
|
||||
height: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
.layui-table .layui-layer-photos {height: 90px;}
|
||||
.layui-table img{
|
||||
max-height: 100%;
|
||||
object-fit: cover;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
max-width: 150px;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layui-row layui-col-space12">
|
||||
<div class="layui-col-xs12 layui-col-md12">
|
||||
<div id="echarts-records" style="background-color:#ffffff;min-height:600px;">
|
||||
<div class="layuimini-container location-index-page">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset" style="display: none">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">关键词</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div>
|
||||
<table id="table-container" class="layui-table" data-url="/manager/bill/index" lay-filter="table-container"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 列 轮播图 -->
|
||||
<script type="text/html" id="row-cover">
|
||||
<div class="layui-layer-photos">
|
||||
<img src="{{ getFileRequestUrl(d.src) }}" layer-src="{{ getFileRequestUrl(d.src) }}" alt="">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="__MANAGER__/js/bill.js?v={:mt_rand()}"></script>
|
|
@ -53,12 +53,15 @@
|
|||
<script type="text/html" id="row-operate">
|
||||
|
||||
{{# if (d.business.state == 0){ }}
|
||||
<a class=" layui-btn layui-btn-primary layui-btn-xs" lay-event="wait" data-href="/manager/business/business-wait.html?business_code={{d.business.code}}&&state=1"
|
||||
<a class=" layui-btn layui-btn-primary layui-btn-xs" lay-event="wait"
|
||||
data-href="/manager/business/business-wait.html?business_code={{d.business.code}}"
|
||||
data-state="1"
|
||||
>
|
||||
通过
|
||||
</a>
|
||||
<a class=" layui-btn layui-btn-primary layui-btn-xs" lay-event="wait"
|
||||
data-href="/manager/business/business-wait.html?business_code={{d.business.code}}&&state=2"
|
||||
data-href="/manager/business/business-wait.html?business_code={{d.business.code}}"
|
||||
data-state="2"
|
||||
>
|
||||
驳回
|
||||
</a>
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
<fieldset class="layui-elem-field layui-field-title site-title">
|
||||
<legend><a name="compatibility">请填写完整整数 总和为100</a></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">渠道商占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="agency" value="{$item.agency ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="admin" value="{$item.admin ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">消费者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="consumer" value="{$item.consumer ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/config/distribution-proportion" lay-submit lay-filter="saveConfig">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,173 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="item[name]" lay-verify="required" value="" lay-reqtext="标题不能为空" placeholder="请输入标题" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">所属商家</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="item[business_code]" lay-search="">
|
||||
<option value=""></option>
|
||||
{foreach $business as $bitem}
|
||||
<option value="{$bitem['code']}">{$bitem['business_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">优惠券类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="item[type]" lay-search="">
|
||||
<option value=""></option>
|
||||
{foreach $type as $titem}
|
||||
<option value="{$titem['id']}">{$titem['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">总数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="item[count]" lay-verify="required|number" value="" lay-reqtext="总数必须大于0,不能为空" placeholder="请输入" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="item[start_time]" lay-verify="required" id="start_time" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="item[end_time]" lay-verify="required" id="end_time" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">金额</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="item[money]" lay-verify="required|number" value="" lay-reqtext="必须>0,不能为空" placeholder="请输入" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label required">扣除金额</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="number" name="item[deduction_money]" lay-verify="required|number" value="" lay-reqtext="必须>=0,不能为空" placeholder="请输入" class="layui-input">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item layui-row field-div current-field-cover" >
|
||||
<label class="layui-form-label">封面:</label>
|
||||
<div class="layui-inline layui-col-xs12 layui-col-md8">
|
||||
<div class="layui-row upload-file-div">
|
||||
<div class=" layui-col-xs12 layui-col-md8">
|
||||
<input class="layui-input upload-file-value" name="item[image_url]" type="text" value="">
|
||||
<div class="layui-form-mid layui-word-aux">图片尺寸:请选择合适尺寸</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-md3">
|
||||
<span>
|
||||
<button type="button" class="layui-btn layui-btn-danger upload-btn">
|
||||
<i class="fa fa-upload"></i> 上传
|
||||
</button>
|
||||
</span>
|
||||
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn" data-url="/manager/attachment/image" data-type="image" data-multiple="false"><i class="fa fa-list"></i> 选择</button></span>
|
||||
</div>
|
||||
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">使用规则</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="item[using_rule]" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">处罚规则</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="item[using_rule]" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" checked="checked" name="item[status]" value="0" title="开启" />
|
||||
<input type="radio" name="item[status]" value="1" title="关闭" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上架状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" checked="checked" name="item[on_shelf]" value="0" title="上架" />
|
||||
<input type="radio" name="item[on_shelf]" value="1" title="下架" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">内容</label>
|
||||
<div class="layui-input-block editor-text">
|
||||
<div class="editor"></div>
|
||||
<textarea name="item[intro]" id="ueditor" class="layui-textarea layui-hide"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title">
|
||||
<legend><a name="compatibility">请填写完整整数 总和为100</a></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">渠道商占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_agency]" lay-verify="required|number" value="{$distributionProportion.agency ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_admin]" lay-verify="required|number" value="{$distributionProportion.admin ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">消费者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_consumer]" lay-verify="required|number" value="{$distributionProportion.consumer ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/coupon/release" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="__MANAGER__/js/coupon/index.js?v={:mt_rand()}"></script>
|
|
@ -0,0 +1,174 @@
|
|||
{layout name="manager/layout" /}
|
||||
<div class="layuimini-container location-operate-page">
|
||||
<div class="layuimini-main">
|
||||
<div class="layui-form layuimini-form">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="item[name]" lay-verify="required" value="{$item['name']}" lay-reqtext="标题不能为空" placeholder="请输入标题" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">所属商家</label>
|
||||
<div class="layui-input-block">
|
||||
<select disabled name="item[business_code]" lay-search="">
|
||||
<option value=""></option>
|
||||
{foreach $business as $bitem}
|
||||
<option value="{$bitem['code']}" {if $item['business_code']==$bitem['code']} selected{/if}>{$bitem['business_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">优惠券类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select disabled lay-search="">
|
||||
<option value=""></option>
|
||||
{foreach $type as $titem}
|
||||
<option value="{$titem['id']}" {if $item['type']==$titem['id']} selected{/if}>{$titem['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">总数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" disabled lay-verify="required|number" value="{$item['count']}" lay-reqtext="总数必须大于0,不能为空" placeholder="请输入" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="item[start_time]" lay-verify="required" value="{$item['start_time']}" id="start_time" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="item[end_time]" lay-verify="required" value="{$item['end_time']}" id="end_time" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">金额</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" lay-verify="required|number" disabled value="{$item['money']}" lay-reqtext="必须>0,不能为空" placeholder="请输入" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label required">扣除金额</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="number" name="item[deduction_money]" lay-verify="required|number" value="" lay-reqtext="必须>=0,不能为空" placeholder="请输入" class="layui-input">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item layui-row field-div current-field-cover" >
|
||||
<label class="layui-form-label">封面:</label>
|
||||
<div class="layui-inline layui-col-xs12 layui-col-md8">
|
||||
<div class="layui-row upload-file-div">
|
||||
<div class=" layui-col-xs12 layui-col-md8">
|
||||
<input class="layui-input upload-file-value" name="item[image_url]" type="text" value="{$item['image_url']}">
|
||||
<div class="layui-form-mid layui-word-aux">图片尺寸:请选择合适尺寸</div>
|
||||
</div>
|
||||
<div class="layui-col-xs12 layui-col-md3">
|
||||
<span>
|
||||
<button type="button" class="layui-btn layui-btn-danger upload-btn">
|
||||
<i class="fa fa-upload"></i> 上传
|
||||
</button>
|
||||
</span>
|
||||
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn" data-url="/manager/attachment/image" data-type="image" data-multiple="false"><i class="fa fa-list"></i> 选择</button></span>
|
||||
</div>
|
||||
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">使用规则</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="item[using_rule]" cols="30" rows="10">{$item['using_rule']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">处罚规则</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="item[using_rule]" cols="30" rows="10">{$item['using_rule']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" {if $item['status']==0 } checked="checked" {/if} name="item[status]" value="0" title="开启" />
|
||||
<input type="radio" {if $item['status']==1 } checked="checked" {/if} name="item[status]" value="1" title="关闭" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上架状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" {if $item['on_shelf']==0 } checked="checked" {/if} name="item[on_shelf]" value="0" title="上架" />
|
||||
<input type="radio" {if $item['on_shelf']==1 } checked="checked" {/if} name="item[on_shelf]" value="1" title="下架" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">内容</label>
|
||||
<div class="layui-input-block editor-text">
|
||||
<div class="editor"></div>
|
||||
<textarea name="item[intro]" id="ueditor" class="layui-textarea layui-hide">{$item["intro"]|raw}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title site-title">
|
||||
<legend><a name="compatibility">请填写完整整数 总和为100</a></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">渠道商占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_agency]" lay-verify="required|number" value="{$item.commission_agency ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_admin]" lay-verify="required|number" value="{$item.commission_admin ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-itemBox2 between-center">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">消费者占比(%)</label>
|
||||
<div class="layui-input-block">
|
||||
<input class="layui-input" type="number" name="item[commission_consumer]" lay-verify="required|number" value="{$item.commission_consumer ?? 0}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{$item['id']}">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" data-url="/manager/coupon/edit" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="__MANAGER__/js/coupon/index.js?v={:mt_rand()}"></script>
|
|
@ -87,21 +87,23 @@
|
|||
|
||||
<!-- 操作列 -->
|
||||
<script type="text/html" id="row-operate">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/info.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】领取日志" lay-event="">领取日志</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/info.html?id={{d.id}}" data-title="【{{ d.name }}】详情" lay-event="info">详情</a>
|
||||
{{# if(d.on_shelf == 1){ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/shelf.html?id={{d.id}}&&on_shelf=0" lay-event="shelf">上架</a>
|
||||
{{# }else{ }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/shelf.html?id={{d.id}}&&on_shelf=1" lay-event="shelf">下架</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/edit.html?id={{d.id}}" data-title="【{{ d.name }}】编辑" lay-event="info">编辑</a>
|
||||
</script>
|
||||
|
||||
<!-- toolbar -->
|
||||
<script type="text/html" id="toolbar-tpl">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-href="/manager/coupon/release" lay-event="release" date-title="发布优惠券">发布优惠券</a>
|
||||
</script>
|
||||
<!-- 列 性别 -->
|
||||
<script type="text/html" id="row-on_shelf">
|
||||
{{# if(d.gender==1){ }}
|
||||
{{# if(d.on_shelf==1){ }}
|
||||
下架
|
||||
{{# }else{ }}
|
||||
上架
|
||||
|
|
|
@ -26,63 +26,89 @@
|
|||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-col-md12">
|
||||
|
||||
<div class="layui-layer-photos">
|
||||
<img id="avatar" src="{$consumer.avatar_url}" layer-src="{$consumer.avatar_url}" alt="">
|
||||
<img id="avatar" src="{$coupon.image_url}" layer-src="{$coupon.image_url}" alt="">
|
||||
<img id="avatar" src="http://yhq.taikoosoft.com:8888/2020-12-08/50b734a826b955fd42d19acddce63b84.jpg" layer-src="http://yhq.taikoosoft.com:8888/2020-12-08/50b734a826b955fd42d19acddce63b84.jpg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md10">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-panel" style="border-radius: 8px;">
|
||||
<div class="layui-row" style="padding: 5% 0;text-align: center">
|
||||
<h3><strong>评论数</strong></h3>
|
||||
<span style="font-size: 36px">{$totalComment ?? 0}</span>
|
||||
<div class="layui-row" >
|
||||
<div class="layui-panel layui-row" style="border-radius: 8px;padding: 8px; ">
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['name']}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-panel" style="border-radius: 8px;">
|
||||
<div class="layui-row" style="padding: 5% 0;text-align: center">
|
||||
<h3><strong>本月评论数</strong></h3>
|
||||
<span style="font-size: 36px">{$totalTheMonthComment ?? 0}</span>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">商家名称</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['business']['business_name']??''}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-panel" style="border-radius: 8px;">
|
||||
<div class="layui-row" style="padding: 5% 0;text-align: center">
|
||||
<h3><strong>标签</strong></h3>
|
||||
<span style="font-size: 32px">{$consumer["tag"]["name"] ?? '无'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-panel" style="border-radius: 8px;">
|
||||
<div class="layui-row" style="padding: 5% 0;text-align: center">
|
||||
<h3><strong>优惠券领取总数</strong></h3>
|
||||
<span style="font-size: 36px">{$couponTotalCount ?? 0}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-panel" style="border-radius: 8px;">
|
||||
<div class="layui-row" style="padding: 5% 0;text-align: center">
|
||||
<h3><strong>优惠券使用总数</strong></h3>
|
||||
<span style="font-size: 36px">{$couponUsedTotalCount ?? 0}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="layui-panel" style="border-radius: 8px;">
|
||||
<div class="layui-row" style="padding: 5% 0;text-align: center">
|
||||
<h3><strong>优惠券未使用总数</strong></h3>
|
||||
<span style="font-size: 36px">{$couponNotUsedTotalCount ?? 0}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">优惠券类型</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['couponType']['name']??$coupon['type_name']}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">优惠券金额</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['money']}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">优惠券数量</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['count']}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">扣除金额</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['deduction_money']}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">开始时间</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['start_time']}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="layui-inline layui-col-md6">
|
||||
<label class="layui-form-label">结束时间</label>
|
||||
<div class="layui-inline">
|
||||
<input type="text" name="keyword" disabled class="layui-input" value="{$coupon['end_time']}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">使用规则</label>
|
||||
<div class="layui-inline">
|
||||
<textarea name="" cols="100" rows="3" disabled>{$coupon['using_rule']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline layui-col-md12">
|
||||
<label class="layui-form-label">处罚规则</label>
|
||||
<div class="layui-inline">
|
||||
<textarea name="" cols="100" rows="3" disabled>{$coupon['punishing_rule']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -95,7 +121,7 @@
|
|||
<div class="layuimini-container location-index-page">
|
||||
<div class="layuimini-main">
|
||||
<div>
|
||||
<table id="table-container" class="layui-table" data-url="/manager/consumer/info.html?id={$consumer.id}&&sign={$sign}" lay-filter="table-container"></table>
|
||||
<table id="table-container" class="layui-table" data-url="/manager/coupon/info.html?id={$coupon.id}" lay-filter="table-container"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -106,12 +132,10 @@
|
|||
|
||||
<!-- 操作列 -->
|
||||
<script type="text/html" id="row-state">
|
||||
{{ d.time_state }}
|
||||
|
|
||||
{{# if(d.is_verificated == 1){ }}
|
||||
已验证
|
||||
{{# }else{ }}
|
||||
未验证
|
||||
未使用
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
|
@ -130,5 +154,11 @@
|
|||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||
</script>
|
||||
|
||||
<!-- 列 轮播图 -->
|
||||
<script type="text/html" id="row-cover">
|
||||
<div class="layui-layer-photos">
|
||||
<img src="{{ d.account?d.account.avatar_url:'' }}" layer-src="{{ d.account?d.account.avatar_url:'' }}" alt="">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script src="__MANAGER__/js/consumer/info.js?v={:mt_rand()}"></script>
|
||||
<script src="__MANAGER__/js/coupon/info.js?v={:mt_rand()}"></script>
|
Loading…
Reference in New Issue