You've already forked guangan
Compare commits
7 Commits
0b1078aeb8
...
940fa02adf
Author | SHA1 | Date | |
---|---|---|---|
940fa02adf | |||
e7d86d685f | |||
0d82756571 | |||
7fbc805750 | |||
75a6472987 | |||
b7b0b39173 | |||
2f397ee7b8 |
@ -9,7 +9,7 @@ class Article extends Controller
|
||||
{
|
||||
public function index() {
|
||||
$categoryId = $this->request->get('cid');
|
||||
$query = CmsArticle::mk()->where('status', 1);
|
||||
$query = CmsArticle::mk()->where('status', 1)->where('is_deleted', 0);
|
||||
if (is_numeric($categoryId)) {
|
||||
$query->hasWhere('cateids', function ($subQuery) use ($categoryId) {
|
||||
$subQuery->where('cid', $categoryId);
|
||||
@ -21,7 +21,7 @@ class Article extends Controller
|
||||
|
||||
public function info() {
|
||||
$id = $this->request->get('id');
|
||||
$article = CmsArticle::mk()->where('id', $id)->find();
|
||||
$article = CmsArticle::mk()->where('id', $id)->where('is_deleted', 0)->find();
|
||||
if (empty($article)) {
|
||||
$this->error('文章不存在');
|
||||
}
|
||||
|
@ -8,7 +8,12 @@ use think\admin\Controller;
|
||||
class Category extends Controller
|
||||
{
|
||||
public function index() {
|
||||
$categories = CmsCategory::mk()->where('status', 1)->order('sort asc,id desc')->field("id, name")->select();
|
||||
$pid = $this->request->get('pid');
|
||||
$query = CmsCategory::mk()->where('status', 1)->order('sort asc,id desc')->field("id, name");
|
||||
if ($pid > 0) {
|
||||
$query->where('pid', $pid);
|
||||
}
|
||||
$categories = $query->select();
|
||||
$this->success('获取分类成功', $categories);
|
||||
}
|
||||
}
|
@ -8,7 +8,13 @@ use think\admin\Controller;
|
||||
class Tutorial extends Controller
|
||||
{
|
||||
public function index() {
|
||||
$categoryId = $this->request->get('cid');
|
||||
$query = CmsTutorial::mk()->where('status', 1);
|
||||
if ($categoryId > 0) {
|
||||
$query->hasWhere('cateids', function ($subQuery) use ($categoryId) {
|
||||
$subQuery->where('cid', $categoryId);
|
||||
});
|
||||
}
|
||||
$articles = $query->order('sort asc,create_at desc')->paginate();
|
||||
$this->success('获取文章列表', $articles);
|
||||
}
|
||||
|
@ -14,6 +14,10 @@ class CmsTutorial extends Model
|
||||
return $this->belongsToMany(CmsCategory::class, CmsTutorialCategory::class, 'cid', 'tid');
|
||||
}
|
||||
|
||||
public function cateids()
|
||||
{
|
||||
return $this->hasMany(CmsTutorialCategory::class, 'tid');
|
||||
}
|
||||
/**
|
||||
* 获取分类ID列表
|
||||
*/
|
||||
|
@ -21,7 +21,7 @@
|
||||
<select name="status">
|
||||
<option value="">请选择</option>
|
||||
<option value="1" {if input('get.status')==1}selected{/if}>启用</option>
|
||||
<option value="0" {if input('get.status')==0}selected{/if}>禁用</option>
|
||||
<option value="0" {if input('get.status', -1)==0}selected{/if}>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@ class UserPoint extends Auth
|
||||
}
|
||||
|
||||
public function myPointLog() {
|
||||
$page = PointsMallUserPointLog::mk()->where('uid', $this->usid)->order('create_at desc')->paginate();
|
||||
$page = PointsMallUserPointLog::mk()->where('uid', $this->usid)->where("point", "<>", 0)->order('create_at desc')->paginate();
|
||||
$this->success('获取积分记录', $page);
|
||||
}
|
||||
}
|
@ -8,24 +8,7 @@
|
||||
{block name="content"}
|
||||
{include file='goods/form_style'}
|
||||
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">
|
||||
<div class="layui-card-body">
|
||||
|
||||
<!--{notempty name='marks'}-->
|
||||
<div class="layui-form-item">
|
||||
<span class="help-label label-required-prev"><b>商品标签</b>Goods Mark</span>
|
||||
<div class="layui-textarea help-checks">
|
||||
{foreach $marks as $mark}
|
||||
<label class="think-checkbox">
|
||||
{if isset($vo.marks) && is_array($vo.marks) && in_array($mark, $vo.marks)}
|
||||
<input name="marks[]" type="checkbox" value="{$mark}" lay-ignore checked> {$mark}
|
||||
{else}
|
||||
<input name="marks[]" type="checkbox" value="{$mark}" lay-ignore> {$mark}
|
||||
{/if}
|
||||
</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<!--{/notempty}-->
|
||||
<div class="layui-card-body" style="margin-top: 50px">
|
||||
|
||||
<!--{notempty name='cates'}-->
|
||||
<div class="layui-form-item block relative">
|
||||
|
@ -41,7 +41,6 @@
|
||||
$('#OrderTable').layTable({
|
||||
even: true, height: 'full', sort: {field: 'id', type: 'desc'},
|
||||
cols: [[
|
||||
{field: 'headimg', title: '头 像', width: 90, align: 'center', templet: '<div>{{-showTableImage(d.user.headimg,true,"md")}}</div>'},
|
||||
{
|
||||
title: '会员用户', width: 170, templet: function (d) {
|
||||
let tpls = [];
|
||||
|
@ -33,14 +33,13 @@
|
||||
return _.join(' ');
|
||||
}
|
||||
|
||||
let tstatus = ['已取消', '待发货', '已发货', '已收货'];
|
||||
let tstyles = ['layui-bg-gray layui-border-red', 'layui-bg-black', 'layui-bg-blue', 'layui-bg-green'];
|
||||
var tstatus = ['已取消', '待发货', '已发货', '已收货'];
|
||||
var tstyles = ['layui-bg-gray layui-border-red', 'layui-bg-black', 'layui-bg-blue', 'layui-bg-green'];
|
||||
|
||||
$(function () {
|
||||
$('#SenderTable').layTable({
|
||||
even: true, height: 'full', sort: {field: 'id', type: 'desc'},
|
||||
cols: [[
|
||||
{field: 'headimg', title: '头 像', width: 90, align: 'center', templet: '<div>{{-showTableImage(d.user.headimg,true,"md")}}</div>'},
|
||||
{
|
||||
field: 'unid', title: '会员用户', width: 170, templet: function (d) {
|
||||
let tpls = [];
|
||||
|
@ -168,6 +168,50 @@ class TicketInter extends Controller
|
||||
$this->success('创建成功!');
|
||||
}
|
||||
|
||||
public function view_ticket_create()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
'ticket_id.require'=>'请指定工单ID!',
|
||||
]);
|
||||
$ticket = TicketTicket::query()->with(['view_process'])->append(['imgs_arr', 'type_name'])->where('id', '=', $data['ticket_id'])->findOrEmpty();
|
||||
$staffs = InspectionStaff::query()->field('id,name,phone')->select();
|
||||
if ($ticket->isEmpty()) {
|
||||
$this->error('未找到工单信息');
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$adminInfo = $this->request->session('user');
|
||||
$instance_data = $this->_vali([
|
||||
'staff_id.require'=>'请指定维修人员!',
|
||||
]);
|
||||
$staff = InspectionStaff::query()->where('id', '=', $instance_data['staff_id'])->findOrEmpty();
|
||||
if ($staff->isEmpty()) {
|
||||
$this->error('未找到维修人员信息');
|
||||
}
|
||||
$ticket->gc_content = '';
|
||||
$ticket->zf_content = '';
|
||||
$ticket->ys_content = '';
|
||||
$ticket->work_days = null;
|
||||
$view = $ticket->views()->save([
|
||||
'staff_id'=>$instance_data['staff_id'],
|
||||
'status'=>0,
|
||||
'create_id'=>$adminInfo['id'],
|
||||
]);
|
||||
$staff->messages()->save([
|
||||
'status'=>0,
|
||||
'title'=>'您有新的核验工单需要处理',
|
||||
'content'=>'您有新的核验工单需要处理,请及时处理。',
|
||||
'type' => 'TICKET_VIEW',
|
||||
'oid' => $view->id,
|
||||
]);
|
||||
$ticket->save();
|
||||
$this->success('创建成功!', $view);
|
||||
} else {
|
||||
$this->vo = $ticket;
|
||||
$this->staffs = $staffs;
|
||||
$this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
public function repair_process_create()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
@ -286,7 +330,6 @@ class TicketInter extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function verify_process_create()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
|
@ -43,4 +43,38 @@ class UserShare extends Auth
|
||||
$id = TicketUserShare::query()->insert($data, true);
|
||||
$this->success('添加随手拍成功', $id);
|
||||
}
|
||||
|
||||
private static $lbs_key = "JJWBZ-YLGLA-LCIKH-CH6C7-VVXC2-J5BEF";
|
||||
|
||||
public function query_address()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
'lat.require' => '纬度不能为空',
|
||||
'lng.require' => '经度不能为空',
|
||||
]);
|
||||
$url = "https://apis.map.qq.com/ws/geocoder/v1/?location={$data['lat']},{$data['lng']}&key=".self::$lbs_key;
|
||||
$result = http_get($url);
|
||||
$result = json_decode($result, true);
|
||||
if ($result['status'] == 0) {
|
||||
// 只支持广安市广安区免省市区
|
||||
$address = $result['result']['address'];
|
||||
$address_component = $result['result']['address_component'];
|
||||
if (isset($address_component['province']) && $address_component['province'] != '四川省') {
|
||||
$address = $result['result']['address'];
|
||||
} else {
|
||||
if (isset($address_component['city']) && $address_component['city'] != '广安市') {
|
||||
$address = $result['result']['address'];
|
||||
} else {
|
||||
if (isset($address_component['district']) && $address_component['district'] != '广安区') {
|
||||
$address = $address_component['district'] + $address_component['street'] + $address_component['street_number'];
|
||||
} else {
|
||||
$address = $address_component['street'] + $address_component['street_number'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->success('查询成功', $address);
|
||||
} else {
|
||||
$this->error('查询失败');
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<form class="layui-form layui-card" action="{:sysuri()}" data-auto="true" method="post" autocomplete="off" style="min-height: 300px">
|
||||
<input class="layui-input layui-hide" type='hidden' value="{:input('get.ticket_id')}" name='ticket_id'>
|
||||
<input class="layui-input layui-hide" type='hidden' value='{:systoken("view_ticket_create")}' name='_token_'>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">选择维修人员</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="staff_id">
|
||||
<option value="">请选择维修负责人员</option>
|
||||
{foreach $staffs as $item}
|
||||
<option value="{$item.id}">{$item.name} ({$item.phone})</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item text-center">
|
||||
<button class="layui-btn layui-btn-normal" type='submit'>创建核验工单</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消</button>
|
||||
</div>
|
||||
</form>
|
Reference in New Issue
Block a user