Files
guangan/plugs/think-plugs-ticket/src/controller/UserShare.php
2024-12-01 14:11:10 +08:00

54 lines
1.4 KiB
PHP

<?php
namespace plugin\ticket\controller;
use plugin\ticket\model\TicketType;
use plugin\ticket\model\TicketUserShare;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
/**
* 用户随手拍
*/
class UserShare extends Controller
{
/**
* 随手拍列表
* @auth true
* @menu true
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
$this->title = '用户随手拍';
$this->type_list = TicketType::getList();
TicketUserShare::mQuery()->layTable(function () {
}, function (QueryHelper $query) {
$query->like(['title|content|ticket_address|contact_phone#keyword'])
->dateBetween(['create_at'])
->equal(['status', 'type_id']);
$query->append(['imgs_arr', 'type_name']);
});
}
/**
* 随手拍详情
* @auth true
* @menu true
* @return void
*/
public function detail()
{
$this->title = '随手拍详情';
$where = $this->_vali([
'id.require' => '随手拍ID不能为空',
]);
$this->vo = TicketUserShare::mk()->where($where)->findOrEmpty();
if ($this->vo->isEmpty()) $this->error('用户随手拍不存在!');
$this->fetch('detail');
}
}