mirror of https://gitee.com/karson/fastadmin.git
commit
270604e5bc
|
|
@ -1,15 +0,0 @@
|
|||
/nbproject/
|
||||
/thinkphp/
|
||||
/vendor/
|
||||
/runtime/
|
||||
/addons/*
|
||||
/application/admin/command/Install/*.lock
|
||||
/public/assets/libs/
|
||||
/public/assets/addons/*
|
||||
/public/uploads/
|
||||
.idea
|
||||
composer.lock
|
||||
*.log
|
||||
*.css.map
|
||||
!.gitkeep
|
||||
.env
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace addons\alisms;
|
||||
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* Alisms
|
||||
*/
|
||||
class Alisms extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信发送行为
|
||||
* @param Sms $params
|
||||
* @return boolean
|
||||
*/
|
||||
public function smsSend(&$params)
|
||||
{
|
||||
$config = get_addon_config('alisms');
|
||||
$alisms = new library\Alisms();
|
||||
$result = $alisms->mobile($params->mobile)
|
||||
->template($config['template'][$params->event])
|
||||
->param(['code' => $params->code])
|
||||
->send();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信发送通知
|
||||
* @param array $params
|
||||
* @return boolean
|
||||
*/
|
||||
public function smsNotice(&$params)
|
||||
{
|
||||
$alisms = library\Alisms::instance();
|
||||
$result = $alisms->mobile($params['mobile'])
|
||||
->template($params['template'])
|
||||
->param($params)
|
||||
->send();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测验证是否正确
|
||||
* @param Sms $params
|
||||
* @return boolean
|
||||
*/
|
||||
public function smsCheck(&$params)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
return array (
|
||||
0 =>
|
||||
array (
|
||||
'name' => 'key',
|
||||
'title' => '应用key',
|
||||
'type' => 'string',
|
||||
'content' =>
|
||||
array (
|
||||
),
|
||||
'value' => 'LTAIrWkYK52SWqlA',
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'name' => 'secret',
|
||||
'title' => '密钥secret',
|
||||
'type' => 'string',
|
||||
'content' =>
|
||||
array (
|
||||
),
|
||||
'value' => 'mAoToIZsRvuzM1n1Z66uj5cQctawCX',
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'name' => 'sign',
|
||||
'title' => '签名',
|
||||
'type' => 'string',
|
||||
'content' =>
|
||||
array (
|
||||
),
|
||||
'value' => '吉泰隆',
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
'name' => 'template',
|
||||
'title' => '短信模板',
|
||||
'type' => 'array',
|
||||
'content' =>
|
||||
array (
|
||||
),
|
||||
'value' =>
|
||||
array (
|
||||
'register' => 'SMS_114000000',
|
||||
'resetpwd' => 'SMS_114000000',
|
||||
'changepwd' => 'SMS_114000000',
|
||||
'短信验证码' => 'SMS_119078242',
|
||||
),
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
);
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace addons\alisms\controller;
|
||||
|
||||
use think\addons\Controller;
|
||||
|
||||
/**
|
||||
* 二维码生成
|
||||
*
|
||||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
//
|
||||
public function index()
|
||||
{
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
public function send()
|
||||
{
|
||||
$mobile = $this->request->post('mobile');
|
||||
$template = $this->request->post('template');
|
||||
$sign = $this->request->post('sign');
|
||||
$param = (array) json_decode($this->request->post('param'));
|
||||
$alisms = new \addons\alisms\library\Alisms();
|
||||
$ret = $alisms->mobile($mobile)
|
||||
->template($template)
|
||||
->sign($sign)
|
||||
->param($param)
|
||||
->send();
|
||||
if ($ret)
|
||||
{
|
||||
$this->success("发送成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error("发送失败!失败原因:" . $alisms->getError());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name = alisms
|
||||
title = 阿里短信发送
|
||||
intro = 阿里短信发送插件
|
||||
author = Karson
|
||||
website = http://www.fastadmin.net
|
||||
version = 1.0.1
|
||||
state = 1
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
CREATE TABLE IF NOT EXISTS `__PREFIX__mobile_code` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`type` varchar(30) NOT NULL DEFAULT '' COMMENT '类型',
|
||||
`mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号',
|
||||
`code` varchar(10) DEFAULT '' COMMENT '验证码',
|
||||
`times` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '验证次数',
|
||||
`createtime` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='短信验证码表';
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
<?php
|
||||
|
||||
namespace addons\alisms\library;
|
||||
|
||||
use think\Config;
|
||||
|
||||
/**
|
||||
* 阿里大于SMS短信发送
|
||||
*/
|
||||
class Alisms
|
||||
{
|
||||
|
||||
private $_params = [];
|
||||
public $error = '';
|
||||
protected $config = [];
|
||||
|
||||
public function __construct($options = [])
|
||||
{
|
||||
if ($config = get_addon_config('alisms'))
|
||||
{
|
||||
$this->config = array_merge($this->config, $config);
|
||||
}
|
||||
$this->config = array_merge($this->config, is_array($options) ? $options : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单例
|
||||
* @param array $options 参数
|
||||
* @return Alisms
|
||||
*/
|
||||
public static function instance($options = [])
|
||||
{
|
||||
if (is_null(self::$instance))
|
||||
{
|
||||
self::$instance = new static($options);
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置签名
|
||||
* @param string $sign
|
||||
* @return Alisms
|
||||
*/
|
||||
public function sign($sign = '')
|
||||
{
|
||||
$this->_params['SignName'] = $sign;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置参数
|
||||
* @param array $param
|
||||
* @return Alisms
|
||||
*/
|
||||
public function param(array $param = [])
|
||||
{
|
||||
foreach ($param as $k => &$v)
|
||||
{
|
||||
$v = (string) $v;
|
||||
}
|
||||
unset($v);
|
||||
$this->_params['TemplateParam'] = json_encode($param);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模板
|
||||
* @param string $code 短信模板
|
||||
* @return Alisms
|
||||
*/
|
||||
public function template($code = '')
|
||||
{
|
||||
$this->_params['TemplateCode'] = $code;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收手机
|
||||
* @param string $mobile 手机号码
|
||||
* @return Alisms
|
||||
*/
|
||||
public function mobile($mobile = '')
|
||||
{
|
||||
$this->_params['PhoneNumbers'] = $mobile;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 立即发送
|
||||
* @return boolean
|
||||
*/
|
||||
public function send()
|
||||
{
|
||||
$this->error = '';
|
||||
$params = $this->_params();
|
||||
$params['Signature'] = $this->_signed($params);
|
||||
$response = $this->_curl($params);
|
||||
if ($response !== FALSE)
|
||||
{
|
||||
$res = (array) json_decode($response, TRUE);
|
||||
if (isset($res['Code']) && $res['Code'] == 'OK')
|
||||
return TRUE;
|
||||
$this->error = isset($res['Message']) ? $res['Message'] : 'InvalidResult';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = 'InvalidResult';
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取错误信息
|
||||
* @return array
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
private function _params()
|
||||
{
|
||||
return array_merge([
|
||||
'AccessKeyId' => $this->config['key'],
|
||||
'SignName' => isset($this->config['sign']) ? $this->config['sign'] : '',
|
||||
'Action' => 'SendSms',
|
||||
'Format' => 'JSON',
|
||||
'Version' => '2017-05-25',
|
||||
'SignatureVersion' => '1.0',
|
||||
'SignatureMethod' => 'HMAC-SHA1',
|
||||
'SignatureNonce' => uniqid(),
|
||||
'Timestamp' => gmdate('Y-m-d\TH:i:s\Z'),
|
||||
], $this->_params);
|
||||
}
|
||||
|
||||
private function percentEncode($string)
|
||||
{
|
||||
$string = urlencode($string);
|
||||
$string = preg_replace('/\+/', '%20', $string);
|
||||
$string = preg_replace('/\*/', '%2A', $string);
|
||||
$string = preg_replace('/%7E/', '~', $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
private function _signed($params)
|
||||
{
|
||||
$sign = $this->config['secret'];
|
||||
ksort($params);
|
||||
$canonicalizedQueryString = '';
|
||||
foreach ($params as $key => $value)
|
||||
{
|
||||
$canonicalizedQueryString .= '&' . $this->percentEncode($key) . '=' . $this->percentEncode($value);
|
||||
}
|
||||
$stringToSign = 'GET&%2F&' . $this->percentencode(substr($canonicalizedQueryString, 1));
|
||||
$signature = base64_encode(hash_hmac('sha1', $stringToSign, $sign . '&', true));
|
||||
return $signature;
|
||||
}
|
||||
|
||||
private function _curl($params)
|
||||
{
|
||||
$uri = 'http://dysmsapi.aliyuncs.com/?' . http_build_query($params);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
curl_setopt($ch, CURLOPT_URL, $uri);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.98 Safari/537.36");
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
$reponse = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $reponse;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
|
||||
<title>Alisms短信发送示例</title>
|
||||
<link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="//cdn.fastadmin.net/assets/css/frontend.min.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="well" style="margin-top:30px;">
|
||||
<form class="form-horizontal" action="{:addon_url('alisms/index/send')}">
|
||||
<fieldset>
|
||||
<legend>阿里大于短信发送</legend>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">手机号</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="mobile" placeholder="手机号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">消息模板</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="template" placeholder="消息模板">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">签名</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="text" class="form-control" name="sign" placeholder="消息模板(可以留空)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">消息参数</label>
|
||||
<div class="col-lg-10">
|
||||
<textarea name="param" class="form-control" cols="30" rows="10" placeholder="必须是JSON字符串"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-10 col-lg-offset-2">
|
||||
<button type="submit" class="btn btn-primary">发送</button>
|
||||
<button type="reset" class="btn btn-default">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace addons\crontab;
|
||||
|
||||
use app\common\library\Menu;
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* 定时任务
|
||||
*/
|
||||
class Crontab extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
$menu = [
|
||||
[
|
||||
'name' => 'general/crontab',
|
||||
'title' => '定时任务',
|
||||
'icon' => 'fa fa-tasks',
|
||||
'remark' => '类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell',
|
||||
'sublist' => [
|
||||
['name' => 'general/crontab/index', 'title' => '查看'],
|
||||
['name' => 'general/crontab/add', 'title' => '添加'],
|
||||
['name' => 'general/crontab/edit', 'title' => '编辑 '],
|
||||
['name' => 'general/crontab/del', 'title' => '删除'],
|
||||
['name' => 'general/crontab/multi', 'title' => '批量更新'],
|
||||
]
|
||||
]
|
||||
];
|
||||
Menu::create($menu, 'general');
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
Menu::delete('general/crontab');
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\general;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use Cron\CronExpression;
|
||||
|
||||
/**
|
||||
* 定时任务
|
||||
*
|
||||
* @icon fa fa-tasks
|
||||
* @remark 类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell
|
||||
*/
|
||||
class Crontab extends Backend
|
||||
{
|
||||
|
||||
protected $model = null;
|
||||
protected $noNeedRight = ['check_schedule', 'get_schedule_future'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('Crontab');
|
||||
$this->view->assign('typedata', \app\common\model\Crontab::getTypeList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax())
|
||||
{
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
$total = $this->model
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->count();
|
||||
|
||||
$list = $this->model
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->limit($offset, $limit)
|
||||
->select();
|
||||
foreach ($list as $k => &$v)
|
||||
{
|
||||
$cron = CronExpression::factory($v['schedule']);
|
||||
$v['nexttime'] = $cron->getNextRunDate()->getTimestamp();
|
||||
}
|
||||
$result = array("total" => $total, "rows" => $list);
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断Crontab格式是否正确
|
||||
* @internal
|
||||
*/
|
||||
public function check_schedule()
|
||||
{
|
||||
$row = $this->request->post("row/a");
|
||||
$schedule = isset($row['schedule']) ? $row['schedule'] : '';
|
||||
if (CronExpression::isValidExpression($schedule))
|
||||
{
|
||||
return json(['ok' => '']);
|
||||
}
|
||||
else
|
||||
{
|
||||
return json(['error' => __('Crontab format invalid')]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据Crontab表达式读取未来七次的时间
|
||||
* @internal
|
||||
*/
|
||||
public function get_schedule_future()
|
||||
{
|
||||
$time = [];
|
||||
$schedule = $this->request->post('schedule');
|
||||
$days = (int) $this->request->post('days');
|
||||
try
|
||||
{
|
||||
$cron = CronExpression::factory($schedule);
|
||||
for ($i = 0; $i < $days; $i++)
|
||||
{
|
||||
$time[] = $cron->getNextRunDate(null, $i)->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return json(['futuretime' => $time]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Title' => '任务标题',
|
||||
'Maximums' => '最多执行',
|
||||
'Sleep' => '延迟秒数',
|
||||
'Schedule' => '执行周期',
|
||||
'Executes' => '执行次数',
|
||||
'No limit' => '无限制',
|
||||
'Execute time' => '最后执行时间',
|
||||
'Request Url' => '请求URL',
|
||||
'Execute Sql Script' => '执行SQL',
|
||||
'Execute Shell' => '执行Shell',
|
||||
'Crontab format invalid' => 'Crontab格式错误',
|
||||
'Next execute time' => '下次预计时间',
|
||||
'The next %s times the execution time' => '接下来 %s 次的执行时间',
|
||||
];
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<style type="text/css">
|
||||
#schedulepicker {
|
||||
padding-top:7px;
|
||||
}
|
||||
</style>
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input type="text" class="form-control" id="title" name="row[title]" value="" data-rule="required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_select('row[type]', $typedata, null, ['class'=>'form-control', 'data-rule'=>'required'])}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea name="row[content]" id="conent" cols="30" rows="5" class="form-control" data-rule="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="schedule" class="control-label col-xs-12 col-sm-2">{:__('Schedule')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input type="text" class="form-control" id="schedule" style="font-size:12px;font-family: Verdana;word-spacing:23px;" name="row[schedule]" value="* * * * *" data-rule="required; remote(general/crontab/check_schedule)" />
|
||||
<div id="schedulepicker">
|
||||
<pre><code>* * * * *
|
||||
- - - - -
|
||||
| | | | +--- day of week (0 - 7) (Sunday=0 or 7)
|
||||
| | | +-------- month (1 - 12)
|
||||
| | +------------- day of month (1 - 31)
|
||||
| +------------------ hour (0 - 23)
|
||||
+----------------------- min (0 - 59)</code></pre>
|
||||
<h5>{:__('The next %s times the execution time', '<input type="number" id="pickdays" class="form-control text-center" value="7" style="display: inline-block;width:80px;">')}</h5>
|
||||
<ol id="scheduleresult" class="list-group">
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="maximums" class="control-label col-xs-12 col-sm-2">{:__('Maximums')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="number" class="form-control" id="maximums" name="row[maximums]" value="0" data-rule="required" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="begintime" class="control-label col-xs-12 col-sm-2">{:__('Begin time')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="text" class="form-control datetimepicker" id="begintime" name="row[begintime]" value="" data-rule="{:__('Begin time')}:required" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="endtime" class="control-label col-xs-12 col-sm-2">{:__('End time')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="text" class="form-control datetimepicker" id="endtime" name="row[endtime]" value="" data-rule="{:__('End time')}:required;match(gte, row[begintime], datetime)" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="text" class="form-control" id="weigh" name="row[weigh]" value="0" data-rule="required" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<style type="text/css">
|
||||
#schedulepicker {
|
||||
padding-top:7px;
|
||||
}
|
||||
</style>
|
||||
<form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input type="text" class="form-control" id="title" name="row[title]" value="{$row.title}" data-rule="required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_select('row[type]', $typedata, $row['type'], ['class'=>'form-control', 'data-rule'=>'required'])}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea name="row[content]" id="conent" cols="30" rows="5" class="form-control" data-rule="required">{$row.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="schedule" class="control-label col-xs-12 col-sm-2">{:__('Schedule')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input type="text" class="form-control" id="schedule" style="font-size:12px;font-family: Verdana;word-spacing:23px;" name="row[schedule]" value="{$row.schedule}" data-rule="required; remote(general/crontab/check_schedule)" />
|
||||
<div id="schedulepicker">
|
||||
<pre><code>* * * * *
|
||||
- - - - -
|
||||
| | | | +--- day of week (0 - 7) (Sunday=0 or 7)
|
||||
| | | +-------- month (1 - 12)
|
||||
| | +------------- day of month (1 - 31)
|
||||
| +------------------ hour (0 - 23)
|
||||
+----------------------- min (0 - 59)</code></pre>
|
||||
<h5>{:__('The next %s times the execution time', '<input type="number" id="pickdays" class="form-control text-center" value="7" style="display: inline-block;width:80px;">')}</h5>
|
||||
<ol id="scheduleresult" class="list-group">
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="maximums" class="control-label col-xs-12 col-sm-2">{:__('Maximums')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="number" class="form-control" id="maximums" name="row[maximums]" value="{$row.maximums}" data-rule="required" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="begintime" class="control-label col-xs-12 col-sm-2">{:__('Begin time')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="text" class="form-control datetimepicker" id="begintime" name="row[begintime]" value="{$row.begintime|datetime}" data-rule="{:__('Begin time')}:required" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="endtime" class="control-label col-xs-12 col-sm-2">{:__('End time')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="text" class="form-control datetimepicker" id="endtime" name="row[endtime]" value="{$row.endtime|datetime}" data-rule="{:__('End time')}:required;match(gte, row[begintime], datetime)" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<input type="text" class="form-control" id="weigh" name="row[weigh]" value="{$row.weigh}" data-rule="required" size="6" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hide layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
{:build_toolbar()}
|
||||
<div class="dropdown btn-group {:$auth->check('general/crontab/multi')?'':'hide'}">
|
||||
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
||||
<ul class="dropdown-menu text-left" role="menu">
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover"
|
||||
data-operate-edit="{:$auth->check('general/crontab/edit')}"
|
||||
data-operate-del="{:$auth->check('general/crontab/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Crontab extends Model
|
||||
{
|
||||
|
||||
// 开启自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
// 定义字段类型
|
||||
protected $type = [
|
||||
];
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text'
|
||||
];
|
||||
|
||||
public static function getTypeList()
|
||||
{
|
||||
return [
|
||||
'url' => __('Request Url'),
|
||||
'sql' => __('Execute Sql Script'),
|
||||
'shell' => __('Execute Shell'),
|
||||
];
|
||||
}
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$typelist = self::getTypeList();
|
||||
$value = $value ? $value : $data['type'];
|
||||
return $value && isset($typelist[$value]) ? $typelist[$value] : $value;
|
||||
}
|
||||
|
||||
protected function setBegintimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
protected function setEndtimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
protected function setExecutetimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
<?php
|
||||
|
||||
namespace addons\crontab\controller;
|
||||
|
||||
use app\common\model\Crontab;
|
||||
use Cron\CronExpression;
|
||||
use fast\Http;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Exception;
|
||||
use think\Log;
|
||||
|
||||
/**
|
||||
* 定时任务接口
|
||||
*
|
||||
* 以Crontab方式每分钟定时执行,且只可以Cli方式运行
|
||||
* @internal
|
||||
*/
|
||||
class Autotask extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* 初始化方法,最前且始终执行
|
||||
*/
|
||||
public function _initialize()
|
||||
{
|
||||
// 只可以以cli方式执行
|
||||
if (!$this->request->isCli())
|
||||
$this->error('Autotask script only work at client!');
|
||||
|
||||
parent::_initialize();
|
||||
|
||||
// 清除错误
|
||||
error_reporting(0);
|
||||
|
||||
// 设置永不超时
|
||||
set_time_limit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行定时任务
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$time = time();
|
||||
$logDir = LOG_PATH . 'crontab/';
|
||||
if (!is_dir($logDir))
|
||||
{
|
||||
mkdir($logDir, 0755);
|
||||
}
|
||||
//筛选未过期且未完成的任务
|
||||
$crontabList = Crontab::where('status', '=', 'normal')->order('weigh desc,id desc')->select();
|
||||
foreach ($crontabList as $crontab)
|
||||
{
|
||||
$update = [];
|
||||
$execute = FALSE;
|
||||
if ($time < $crontab['begintime'])
|
||||
{
|
||||
//任务未开始
|
||||
continue;
|
||||
}
|
||||
if ($crontab['maximums'] && $crontab['executes'] > $crontab['maximums'])
|
||||
{
|
||||
//任务已超过最大执行次数
|
||||
$update['status'] = 'completed';
|
||||
}
|
||||
else if ($crontab['endtime'] > 0 && $time > $crontab['endtime'])
|
||||
{
|
||||
//任务已过期
|
||||
$update['status'] = 'expired';
|
||||
}
|
||||
else
|
||||
{
|
||||
//重复执行
|
||||
//如果未到执行时间则继续循环
|
||||
$cron = CronExpression::factory($crontab['schedule']);
|
||||
if (!$cron->isDue() || date("YmdHi") === date("YmdHi", $crontab['executetime']))
|
||||
continue;
|
||||
$execute = TRUE;
|
||||
}
|
||||
|
||||
// 如果允许执行
|
||||
if ($execute)
|
||||
{
|
||||
$update['executetime'] = $time;
|
||||
$update['executes'] = $crontab['executes'] + 1;
|
||||
$update['status'] = ($crontab['maximums'] > 0 && $update['executes'] >= $crontab['maximums']) ? 'completed' : 'normal';
|
||||
}
|
||||
|
||||
// 如果需要更新状态
|
||||
if (!$update)
|
||||
continue;
|
||||
// 更新状态
|
||||
$crontab->save($update);
|
||||
|
||||
// 将执行放在后面是为了避免超时导致多次执行
|
||||
if (!$execute)
|
||||
continue;
|
||||
try
|
||||
{
|
||||
if ($crontab['type'] == 'url')
|
||||
{
|
||||
if (substr($crontab['content'], 0, 1) == "/")
|
||||
{
|
||||
// 本地项目URL
|
||||
exec('nohup php ' . ROOT_PATH . 'public/index.php ' . $crontab['content'] . ' >> ' . $logDir . date("Y-m-d") . '.log 2>&1 &');
|
||||
}
|
||||
else
|
||||
{
|
||||
// 远程异步调用URL
|
||||
Http::sendAsyncRequest($crontab['content']);
|
||||
}
|
||||
}
|
||||
else if ($crontab['type'] == 'sql')
|
||||
{
|
||||
//这里需要强制重连数据库,使用已有的连接会报2014错误
|
||||
$connect = Db::connect([], true);
|
||||
$connect->execute("select 1");
|
||||
// 执行SQL
|
||||
$connect->getPdo()->exec($crontab['content']);
|
||||
}
|
||||
else if ($crontab['type'] == 'shell')
|
||||
{
|
||||
// 执行Shell
|
||||
exec($crontab['content'] . ' >> ' . $logDir . date("Y-m-d") . '.log 2>&1 &');
|
||||
}
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
Log::record($e->getMessage());
|
||||
}
|
||||
}
|
||||
return 'Execute completed!';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace addons\crontab\controller;
|
||||
|
||||
use think\addons\Controller;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error("当前插件暂无前台页面");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name = crontab
|
||||
title = 定时任务
|
||||
intro = 可在线管理Crontab定时任务
|
||||
author = Karson
|
||||
website = http://www.fastadmin.net
|
||||
version = 1.0.0
|
||||
state = 1
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
CREATE TABLE IF NOT EXISTS `__PREFIX__crontab` (
|
||||
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`type` varchar(10) NOT NULL DEFAULT '' COMMENT '事件类型',
|
||||
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '事件标题',
|
||||
`content` text NOT NULL COMMENT '事件内容',
|
||||
`schedule` varchar(100) NOT NULL DEFAULT '' COMMENT 'Crontab格式',
|
||||
`sleep` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '延迟秒数执行',
|
||||
`maximums` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最大执行次数 0为不限',
|
||||
`executes` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '已经执行的次数',
|
||||
`createtime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`updatetime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
`begintime` int(10) NOT NULL DEFAULT '0' COMMENT '开始时间',
|
||||
`endtime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '结束时间',
|
||||
`executetime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后执行时间',
|
||||
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
|
||||
`status` enum('completed','expired','hidden','normal') NOT NULL DEFAULT 'normal' COMMENT '状态',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='定时任务表' ROW_FORMAT=DYNAMIC;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO `__PREFIX__crontab` (`id`, `type`, `title`, `content`, `schedule`, `sleep`, `maximums`, `executes`, `createtime`, `updatetime`, `begintime`, `endtime`, `executetime`, `weigh`, `status`) VALUES
|
||||
(1, 'url', '请求FastAdmin', 'http://www.fastadmin.net', '* * * * *', 0, 0, 13548, 1497070825, 1501253101, 1483200000, 1546272000, 1501253101, 1, 'normal'),
|
||||
(2, 'sql', '查询一条SQL', 'SELECT 1;', '* * * * *', 0, 0, 13548, 1497071095, 1501253101, 1483200000, 1546272000, 1501253101, 2, 'normal');
|
||||
COMMIT;
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'general/crontab/index',
|
||||
add_url: 'general/crontab/add',
|
||||
edit_url: 'general/crontab/edit',
|
||||
del_url: 'general/crontab/del',
|
||||
multi_url: 'general/crontab/multi',
|
||||
table: 'crontab'
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
sortName: 'weigh',
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true, },
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'type_text', title: __('Type'), operate: false},
|
||||
{field: 'title', title: __('Title')},
|
||||
{field: 'maximums', title: __('Maximums'), formatter: Controller.api.formatter.maximums},
|
||||
{field: 'executes', title: __('Executes')},
|
||||
{field: 'begintime', title: __('Begin time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange'},
|
||||
{field: 'endtime', title: __('End time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange'},
|
||||
{field: 'nexttime', title: __('Next execute time'), formatter: Table.api.formatter.datetime, operate: false},
|
||||
{field: 'executetime', title: __('Execute time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange'},
|
||||
{field: 'weigh', title: __('Weigh')},
|
||||
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
$('#schedule').on('valid.field', function (e, result) {
|
||||
$("#pickdays").trigger("change");
|
||||
});
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
$(document).on("change", "#pickdays", function () {
|
||||
$("#scheduleresult").html(__('Loading'));
|
||||
$.post("general/crontab/get_schedule_future", {schedule: $("#schedule").val(), days: $(this).val()}, function (ret) {
|
||||
$("#scheduleresult").html("");
|
||||
if (typeof ret.futuretime !== 'undefined' && $.isArray(ret.futuretime)) {
|
||||
$.each(ret.futuretime, function (i, j) {
|
||||
$("#scheduleresult").append("<li class='list-group-item'>" + j + "<span class='badge'>" + (i + 1) + "</span></li>");
|
||||
});
|
||||
}
|
||||
}, 'json');
|
||||
|
||||
});
|
||||
$("#pickdays").trigger("change");
|
||||
},
|
||||
formatter: {
|
||||
maximums: function (value, row, index) {
|
||||
return value === 0 ? __('No limit') : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace addons\properties;
|
||||
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
class Properties extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
require(['form', 'upload'], function (Form, Upload) {
|
||||
var _bindevent = Form.events.bindevent;
|
||||
Form.events.bindevent = function (form) {
|
||||
_bindevent.apply(this, [form]);
|
||||
try {
|
||||
//绑定自定义属性组件
|
||||
if ($("textarea[id$=Properties]", form).size() > 0) {
|
||||
require(['../addons/properties/Properties'], function (Properties){
|
||||
var obj=$("textarea[id$=Properties]", form);
|
||||
|
||||
var table=Properties.init(obj);
|
||||
|
||||
$(form).on("click",".property_add",function(event){
|
||||
Properties.create(table);
|
||||
})
|
||||
|
||||
$(form).on("click",".property_del",function(event){
|
||||
Properties.remove(table,$(this).parents("tr").data("index"));
|
||||
})
|
||||
|
||||
$(form).on("click",".property_drag",function(event){
|
||||
Properties.sort(table,$(this).data("index"),$(this).data("direction"));
|
||||
})
|
||||
|
||||
$(form).on("change","input",function(event){
|
||||
Properties.set(table,$(this).parents("tr").data("index"));
|
||||
})
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace addons\properties\controller;
|
||||
|
||||
use think\addons\Controller;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error("当前插件暂无前台页面");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name = properties
|
||||
title = 自定义属性插件
|
||||
intro = 自定义属性
|
||||
author = ChrisLeung
|
||||
website = https://github.com/Chrisleung
|
||||
version = 1.0.0
|
||||
state = 1
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
define([],function(){
|
||||
var Properties={
|
||||
formatter:{
|
||||
property: function (value, row, index) {
|
||||
return '<div class="input-group" style="width:100%"><input type="text" class="form-control input-sm" value="'+value+'" ></div>';
|
||||
},
|
||||
operate:function(value,row,index){
|
||||
return '\<div class="btn-group btn-group-justified">\
|
||||
<span class="btn btn-default property_drag" data-index="'+index+'" data-direction="up"><i class="fa fa-arrow-up" aria-hidden="true"></i></span>\
|
||||
<span class="btn btn-default property_drag" data-index="'+index+'" data-direction="down"><i class="fa fa-arrow-down" aria-hidden="true"></i></span>\
|
||||
<span class="btn btn-danger property_del" data-index="'+index+'"><i class="fa fa-times" aria-hidden="true"></i></span></div>';
|
||||
}
|
||||
},
|
||||
//初始化表格
|
||||
init: function(obj) {
|
||||
obj.hide();
|
||||
obj.before("<style>\
|
||||
.swap_done{animation-name: swap;animation-duration: 1s;animation-timing-function: ease-out;animation-direction: alternate;animation-iteration-count: 1;animation-fill-mode: backwards;animation-play-state: running;}\
|
||||
@keyframes swap{0%,100%{background-color:#f1f4f6}50%{background-color:#ddd}}\
|
||||
</style>")
|
||||
.before('<table class="properties"></table>')
|
||||
.before('<button type="button" class="btn btn-success btn-embossed property_add" style="margin-top:15px;">添加参数</button>');
|
||||
var table=obj.parent().find("table.properties")
|
||||
|
||||
if(obj.val()!=""){
|
||||
Properties.create(table);
|
||||
table.bootstrapTable('load',JSON.parse(obj.val()));
|
||||
}
|
||||
|
||||
return table;
|
||||
},
|
||||
//创建表头,若存在则添加一行
|
||||
create:function(table){
|
||||
if(table.find("tbody").size()==0){
|
||||
table.bootstrapTable({
|
||||
showHeader:true,
|
||||
mobileResponsive:true,
|
||||
columns: [{
|
||||
field: 'name',
|
||||
title: '参数名',
|
||||
class: 'property_input',
|
||||
formatter:Properties.formatter.property
|
||||
}, {
|
||||
field: 'value',
|
||||
title: '参数值',
|
||||
class: 'property_input',
|
||||
formatter:Properties.formatter.property
|
||||
},
|
||||
{
|
||||
field: 'operate',
|
||||
title: '操作',
|
||||
width: '150px',
|
||||
formatter:Properties.formatter.operate
|
||||
}],
|
||||
data:[{name:'',value:''}]
|
||||
|
||||
});
|
||||
}else{
|
||||
Properties.append(table);
|
||||
}
|
||||
},
|
||||
//添加
|
||||
append:function(table){
|
||||
var property={
|
||||
name:'',
|
||||
value:''
|
||||
}
|
||||
table.bootstrapTable('append',property)
|
||||
},
|
||||
//删除
|
||||
remove:function(table,index){
|
||||
var data=table.bootstrapTable('getData',true);
|
||||
data.splice(index,1),
|
||||
table.bootstrapTable('load',data)
|
||||
Properties.save(table);
|
||||
},
|
||||
//排序
|
||||
sort:function(table,index,direction){
|
||||
var data=table.bootstrapTable('getData',true);
|
||||
|
||||
switch(direction){
|
||||
case 'up':
|
||||
if(index>0){
|
||||
table.bootstrapTable('load',Properties.swap(data,index,index-1));
|
||||
table.find("tr[data-index="+(index-1)+"]").addClass('swap_done')
|
||||
}else{
|
||||
layer.tips('已经到达顶部',
|
||||
table.find(".property_drag[data-index="+index+"][data-direction="+direction+"]"),
|
||||
{
|
||||
tips:1
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'down':
|
||||
if(index<data.length-1){
|
||||
table.bootstrapTable('load',Properties.swap(data,index,index+1));
|
||||
table.find("tr[data-index="+(index+1)+"]").addClass('swap_done')
|
||||
}else{
|
||||
layer.tips('已经到达底部',
|
||||
table.find(".property_drag[data-index="+index+"][data-direction="+direction+"]"),
|
||||
{
|
||||
tips:1
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Properties.save(table);
|
||||
},
|
||||
|
||||
//设置属性
|
||||
set:function(table,index){
|
||||
|
||||
var property_input=table.find("tr[data-index="+index+"] td.property_input");
|
||||
var property={
|
||||
name:property_input.first().find("input").val(),
|
||||
value:property_input.last().find("input").val()
|
||||
}
|
||||
table.bootstrapTable('updateRow', {
|
||||
index: index,
|
||||
row: property
|
||||
})
|
||||
|
||||
Properties.save(table);
|
||||
},
|
||||
|
||||
//保存
|
||||
save:function(table){
|
||||
table.parents(".bootstrap-table")
|
||||
.siblings('textarea').val(JSON.stringify(table.bootstrapTable('getData',true)))
|
||||
},
|
||||
|
||||
//交换排序
|
||||
swap:function(data, old_pos, new_pos) {
|
||||
data[old_pos] = data.splice(new_pos, 1, data[old_pos])[0];
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
return Properties;
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace addons\summernote;
|
||||
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* Summernote插件
|
||||
*/
|
||||
class Summernote extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
require(['form', 'upload'], function (Form, Upload) {
|
||||
var _bindevent = Form.events.bindevent;
|
||||
Form.events.bindevent = function (form) {
|
||||
_bindevent.apply(this, [form]);
|
||||
try {
|
||||
//绑定summernote事件
|
||||
if ($(".summernote,.editor", form).size() > 0) {
|
||||
require(['summernote'], function () {
|
||||
$(".summernote,.editor", form).summernote({
|
||||
height: 250,
|
||||
lang: 'zh-CN',
|
||||
fontNames: [
|
||||
'Arial', 'Arial Black', 'Serif', 'Sans', 'Courier',
|
||||
'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande',
|
||||
"Open Sans", "Hiragino Sans GB", "Microsoft YaHei",
|
||||
'微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆',
|
||||
],
|
||||
fontNamesIgnoreCheck: [
|
||||
"Open Sans", "Microsoft YaHei",
|
||||
'微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆'
|
||||
],
|
||||
toolbar: [
|
||||
['style', ['style', 'undo', 'redo']],
|
||||
['font', ['bold', 'underline', 'strikethrough', 'clear']],
|
||||
['fontname', ['color', 'fontname', 'fontsize']],
|
||||
['para', ['ul', 'ol', 'paragraph', 'height']],
|
||||
['table', ['table', 'hr']],
|
||||
['insert', ['link', 'picture', 'video']],
|
||||
['view', ['fullscreen', 'codeview', 'help']]
|
||||
],
|
||||
dialogsInBody: true,
|
||||
callbacks: {
|
||||
onChange: function (contents) {
|
||||
$(this).val(contents);
|
||||
$(this).trigger('change');
|
||||
},
|
||||
onInit: function () {
|
||||
},
|
||||
onImageUpload: function (files) {
|
||||
var that = this;
|
||||
//依次上传图片
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
Upload.api.send(files[i], function (data) {
|
||||
var url = Fast.api.cdnurl(data.url);
|
||||
$(that).summernote("insertImage", url, 'filename');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
];
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace addons\summernote\controller;
|
||||
|
||||
use think\addons\Controller;
|
||||
|
||||
class Index extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error("当前插件暂无前台页面");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name = summernote
|
||||
title = Summernote插件
|
||||
intro = 修改后台默认编辑器为Summernote
|
||||
author = Karson
|
||||
website = http://www.fastadmin.net
|
||||
version = 1.0.1
|
||||
state = 1
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third;
|
||||
|
||||
use think\Addons;
|
||||
|
||||
/**
|
||||
* 第三方登录
|
||||
*/
|
||||
class Third extends Addons
|
||||
{
|
||||
|
||||
/**
|
||||
* 插件安装方法
|
||||
* @return bool
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载方法
|
||||
* @return bool
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
0 =>
|
||||
array(
|
||||
'name' => 'qq',
|
||||
'title' => 'QQ',
|
||||
'type' => 'array',
|
||||
'content' =>
|
||||
array(
|
||||
'app_id' => '',
|
||||
'app_secret' => '',
|
||||
'scope' => 'get_user_info',
|
||||
),
|
||||
'value' =>
|
||||
array(
|
||||
'app_id' => '100246200',
|
||||
'app_secret' => '0d4d1bf5210f167226c49f4eb3715512',
|
||||
'scope' => 'get_user_info',
|
||||
),
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
1 =>
|
||||
array(
|
||||
'name' => 'wechat',
|
||||
'title' => '微信',
|
||||
'type' => 'array',
|
||||
'content' =>
|
||||
array(
|
||||
'app_id' => '',
|
||||
'app_secret' => '',
|
||||
'callback' => '',
|
||||
'scope' => 'snsapi_userinfo',
|
||||
),
|
||||
'value' =>
|
||||
array(
|
||||
'app_id' => 'wx91b3fe578d6467ac',
|
||||
'app_secret' => 'aa6726df5cb2b6278d7f373d009510d0',
|
||||
'scope' => 'get_user_info',
|
||||
),
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
2 =>
|
||||
array(
|
||||
'name' => 'weibo',
|
||||
'title' => '微博',
|
||||
'type' => 'array',
|
||||
'content' =>
|
||||
array(
|
||||
'app_id' => '',
|
||||
'app_secret' => '',
|
||||
'scope' => 'get_user_info',
|
||||
),
|
||||
'value' =>
|
||||
array(
|
||||
'app_id' => '645217067',
|
||||
'app_secret' => '226b4baaf3799e88dec7fcabf5837185',
|
||||
'scope' => 'get_user_info',
|
||||
),
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
'tip' => '',
|
||||
'ok' => '',
|
||||
'extend' => '',
|
||||
),
|
||||
);
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\controller;
|
||||
|
||||
/**
|
||||
* 第三方登录
|
||||
*/
|
||||
class Index extends \think\addons\Controller
|
||||
{
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error("当前插件暂无前台页面");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
name = third
|
||||
title = 第三方登录
|
||||
intro = 使用微信、QQ、微博登录插件
|
||||
author = Karson
|
||||
website = http://www.fastadmin.net
|
||||
version = 1.0.1
|
||||
state = 1
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
CREATE TABLE IF NOT EXISTS `__PREFIX__third` (
|
||||
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '会员ID',
|
||||
`platform` enum('weibo','wechat','qq') NOT NULL COMMENT '第三方应用',
|
||||
`openid` varchar(50) NOT NULL DEFAULT '' COMMENT '第三方唯一ID',
|
||||
`openname` varchar(50) NOT NULL DEFAULT '' COMMENT '第三方会员昵称',
|
||||
`access_token` varchar(100) NOT NULL DEFAULT '',
|
||||
`refresh_token` varchar(100) NOT NULL DEFAULT '',
|
||||
`expires_in` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '有效期',
|
||||
`createtime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`updatetime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新时间',
|
||||
`logintime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '登录时间',
|
||||
`expiretime` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '过期时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `platform` (`platform`,`openid`),
|
||||
KEY `user_id` (`user_id`,`platform`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='第三方登录表' ROW_FORMAT=DYNAMIC;
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\library;
|
||||
|
||||
class Application
|
||||
{
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
* @var array
|
||||
*/
|
||||
private $config = [];
|
||||
|
||||
/**
|
||||
* 服务提供者
|
||||
* @var array
|
||||
*/
|
||||
private $providers = [
|
||||
'qq' => 'Qq',
|
||||
'weibo' => 'Weibo',
|
||||
'wechat' => 'Wechat',
|
||||
];
|
||||
|
||||
/**
|
||||
* 服务对象信息
|
||||
* @var array
|
||||
*/
|
||||
protected $services = [];
|
||||
|
||||
public function __construct($options = [])
|
||||
{
|
||||
$this->config = array_merge($this->config, is_array($options) ? $options : []);
|
||||
|
||||
//注册服务器提供者
|
||||
$this->registerProviders();
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册服务提供者
|
||||
*/
|
||||
private function registerProviders()
|
||||
{
|
||||
foreach ($this->providers as $k => $v)
|
||||
{
|
||||
$this->services[$k] = function() use ($k, $v) {
|
||||
$options = $this->config[$k];
|
||||
$options['app_id'] = isset($options['app_id']) ? $options['app_id'] : '';
|
||||
$options['app_secret'] = isset($options['app_secret']) ? $options['app_secret'] : '';
|
||||
// 如果未定义回调地址则自动生成
|
||||
$options['callback'] = isset($options['callback']) && $options['callback'] ? $options['callback'] : url('/', [], false, true);
|
||||
$objname = __NAMESPACE__ . "\\{$v}";
|
||||
return new $objname($options);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public function __set($key, $value)
|
||||
{
|
||||
$this->services[$key] = $value;
|
||||
}
|
||||
|
||||
public function __get($key)
|
||||
{
|
||||
return $this->services[$key]($this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\library;
|
||||
|
||||
use fast\Http;
|
||||
use think\Config;
|
||||
use think\Session;
|
||||
|
||||
/**
|
||||
* QQ
|
||||
*/
|
||||
class Qq
|
||||
{
|
||||
|
||||
const GET_AUTH_CODE_URL = "https://graph.qq.com/oauth2.0/authorize";
|
||||
const GET_ACCESS_TOKEN_URL = "https://graph.qq.com/oauth2.0/token";
|
||||
const GET_USERINFO_URL = "https://graph.qq.com/user/get_user_info";
|
||||
const GET_OPENID_URL = "https://graph.qq.com/oauth2.0/me";
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
* @var array
|
||||
*/
|
||||
private $config = [];
|
||||
|
||||
public function __construct($options = [])
|
||||
{
|
||||
if ($config = Config::get('third.qq'))
|
||||
{
|
||||
$this->config = array_merge($this->config, $config);
|
||||
}
|
||||
$this->config = array_merge($this->config, is_array($options) ? $options : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
header("Location:" . $this->getAuthorizeUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取authorize_url
|
||||
*/
|
||||
public function getAuthorizeUrl()
|
||||
{
|
||||
$state = md5(uniqid(rand(), TRUE));
|
||||
Session::set('state', $state);
|
||||
$queryarr = array(
|
||||
"response_type" => "code",
|
||||
"client_id" => $this->config['app_id'],
|
||||
"redirect_uri" => $this->config['callback'],
|
||||
"scope" => $this->config['scope'],
|
||||
"state" => $state,
|
||||
);
|
||||
request()->isMobile() && $queryarr['display'] = 'mobile';
|
||||
$url = self::GET_AUTH_CODE_URL . '?' . http_build_query($queryarr);
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getUserInfo($params = [])
|
||||
{
|
||||
$params = $params ? $params : $_GET;
|
||||
if (isset($params['access_token']) || (isset($params['state']) && $params['state'] == Session::get('state') && isset($params['code'])))
|
||||
{
|
||||
//获取access_token
|
||||
$data = isset($params['code']) ? $this->getAccessToken($params['code']) : $params;
|
||||
$access_token = isset($data['access_token']) ? $data['access_token'] : '';
|
||||
$refresh_token = isset($data['refresh_token']) ? $data['refresh_token'] : '';
|
||||
$expires_in = isset($data['expires_in']) ? $data['expires_in'] : 0;
|
||||
if ($access_token)
|
||||
{
|
||||
$openid = $this->getOpenId($access_token);
|
||||
//获取用户信息
|
||||
$queryarr = [
|
||||
"access_token" => $access_token,
|
||||
"oauth_consumer_key" => $this->config['app_id'],
|
||||
"openid" => $openid,
|
||||
];
|
||||
$ret = Http::get(self::GET_USERINFO_URL, $queryarr);
|
||||
$userinfo = json_decode($ret, TRUE);
|
||||
if (!$userinfo || !isset($userinfo['ret']) || $userinfo['ret'] !== 0)
|
||||
return [];
|
||||
$userinfo = $userinfo ? $userinfo : [];
|
||||
$userinfo['avatar'] = isset($userinfo['figureurl_qq_2']) ? $userinfo['figureurl_qq_2'] : '';
|
||||
$data = [
|
||||
'access_token' => $access_token,
|
||||
'refresh_token' => $refresh_token,
|
||||
'expires_in' => $expires_in,
|
||||
'openid' => $openid,
|
||||
'userinfo' => $userinfo
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取access_token
|
||||
* @param string $code
|
||||
* @return array
|
||||
*/
|
||||
private function getAccessToken($code = '')
|
||||
{
|
||||
if (!$code)
|
||||
return '';
|
||||
$queryarr = array(
|
||||
"grant_type" => "authorization_code",
|
||||
"client_id" => $this->config['app_id'],
|
||||
"client_secret" => $this->config['app_secret'],
|
||||
"redirect_uri" => $this->config['callback'],
|
||||
"code" => $code,
|
||||
);
|
||||
$ret = Http::get(self::GET_ACCESS_TOKEN_URL, $queryarr);
|
||||
$params = [];
|
||||
parse_str($ret, $params);
|
||||
return $params ? $params : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取open_id
|
||||
* @param string $access_token
|
||||
* @return string
|
||||
*/
|
||||
private function getOpenId($access_token = '')
|
||||
{
|
||||
$response = Http::get(self::GET_OPENID_URL, ['access_token' => $access_token]);
|
||||
if (strpos($response, "callback") !== false)
|
||||
{
|
||||
$lpos = strpos($response, "(");
|
||||
$rpos = strrpos($response, ")");
|
||||
$response = substr($response, $lpos + 1, $rpos - $lpos - 1);
|
||||
}
|
||||
$user = json_decode($response, TRUE);
|
||||
return isset($user['openid']) ? $user['openid'] : '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\library;
|
||||
|
||||
use addons\third\model\Third;
|
||||
use fast\Random;
|
||||
|
||||
/**
|
||||
* 第三方登录服务类
|
||||
*
|
||||
* @author Karson
|
||||
*/
|
||||
class Service
|
||||
{
|
||||
|
||||
/**
|
||||
* 第三方登录
|
||||
* @param string $platform 平台
|
||||
* @param array $params 参数
|
||||
* @param int $keeptime 有效时长
|
||||
* @return boolean
|
||||
*/
|
||||
public static function connect($platform, $params = [], $keeptime = 0)
|
||||
{
|
||||
$time = time();
|
||||
$values = [
|
||||
'platform' => $platform,
|
||||
'openid' => $params['openid'],
|
||||
'openname' => isset($params['userinfo']['nickname']) ? $params['userinfo']['nickname'] : '',
|
||||
'access_token' => $params['access_token'],
|
||||
'refresh_token' => $params['refresh_token'],
|
||||
'expires_in' => $params['expires_in'],
|
||||
'logintime' => $time,
|
||||
'expiretime' => $time + $params['expires_in'],
|
||||
];
|
||||
$auth = \app\common\library\Auth::instance();
|
||||
|
||||
$auth->keeptime($keeptime);
|
||||
$third = Third::get(['platform' => $platform, 'openid' => $params['openid']]);
|
||||
if ($third)
|
||||
{
|
||||
$user = \addons\user\model\User::get($third['user_id']);
|
||||
if (!$user)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$third->save($values);
|
||||
return $auth->direct($user->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 先随机一个用户名,随后再变更为u+数字id
|
||||
$username = Random::alnum(20);
|
||||
$password = Random::alnum(6);
|
||||
// 默认注册一个会员
|
||||
$result = $auth->register($username, $password, '', '', [], $keeptime);
|
||||
if (!$result)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$user = $auth->getUser();
|
||||
$fields = ['username' => 'u' . $user->id];
|
||||
if (isset($params['userinfo']['nickname']))
|
||||
$fields['nickname'] = $params['userinfo']['nickname'];
|
||||
if (isset($params['userinfo']['avatar']))
|
||||
$fields['avatar'] = $params['userinfo']['avatar'];
|
||||
|
||||
// 更新会员资料
|
||||
$user->save($fields);
|
||||
|
||||
// 保存第三方信息
|
||||
$values['user_id'] = $user->id;
|
||||
Third::create($values);
|
||||
|
||||
// 写入登录Cookies和Token
|
||||
return $auth->direct($user->id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\library;
|
||||
|
||||
use fast\Http;
|
||||
use think\Config;
|
||||
use think\Session;
|
||||
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
class Wechat
|
||||
{
|
||||
|
||||
const GET_AUTH_CODE_URL = "https://open.weixin.qq.com/connect/oauth2/authorize";
|
||||
const GET_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token";
|
||||
const GET_USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo";
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
* @var array
|
||||
*/
|
||||
private $config = [];
|
||||
|
||||
public function __construct($options = [])
|
||||
{
|
||||
if ($config = Config::get('third.wechat'))
|
||||
{
|
||||
$this->config = array_merge($this->config, $config);
|
||||
}
|
||||
$this->config = array_merge($this->config, is_array($options) ? $options : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
header("Location:" . $this->getAuthorizeUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取authorize_url
|
||||
*/
|
||||
public function getAuthorizeUrl()
|
||||
{
|
||||
$state = md5(uniqid(rand(), TRUE));
|
||||
Session::set('state', $state);
|
||||
$queryarr = array(
|
||||
"appid" => $this->config['app_id'],
|
||||
"redirect_uri" => $this->config['callback'],
|
||||
"response_type" => "code",
|
||||
"scope" => $this->config['scope'],
|
||||
"state" => $state,
|
||||
);
|
||||
request()->isMobile() && $queryarr['display'] = 'mobile';
|
||||
$url = self::GET_AUTH_CODE_URL . '?' . http_build_query($queryarr) . '#wechat_redirect';
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getUserInfo($params = [])
|
||||
{
|
||||
$params = $params ? $params : $_GET;
|
||||
if (isset($params['access_token']) || (isset($params['state']) && $params['state'] == Session::get('state') && isset($params['code'])))
|
||||
{
|
||||
//获取access_token
|
||||
$data = isset($params['code']) ? $this->getAccessToken($params['code']) : $params;
|
||||
$access_token = isset($data['access_token']) ? $data['access_token'] : '';
|
||||
$refresh_token = isset($data['refresh_token']) ? $data['refresh_token'] : '';
|
||||
$expires_in = isset($data['expires_in']) ? $data['expires_in'] : 0;
|
||||
if ($access_token)
|
||||
{
|
||||
$openid = isset($data['openid']) ? $data['openid'] : '';
|
||||
$unionid = isset($data['unionid']) ? $data['unionid'] : '';
|
||||
//获取用户信息
|
||||
$queryarr = [
|
||||
"access_token" => $access_token,
|
||||
"openid" => $openid,
|
||||
"lang" => 'zh_CN'
|
||||
];
|
||||
$ret = Http::post(self::GET_USERINFO_URL, $queryarr);
|
||||
$userinfo = json_decode($ret, TRUE);
|
||||
if (!$userinfo || isset($userinfo['errcode']))
|
||||
return [];
|
||||
$userinfo = $userinfo ? $userinfo : [];
|
||||
$userinfo['avatar'] = isset($userinfo['headimgurl']) ? $userinfo['headimgurl'] : '';
|
||||
$data = [
|
||||
'access_token' => $access_token,
|
||||
'refresh_token' => $refresh_token,
|
||||
'expires_in' => $expires_in,
|
||||
'openid' => $openid,
|
||||
'unionid' => $unionid,
|
||||
'userinfo' => $userinfo
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取access_token
|
||||
* @param string code
|
||||
* @return array
|
||||
*/
|
||||
private function getAccessToken($code = '')
|
||||
{
|
||||
if (!$code)
|
||||
return '';
|
||||
$queryarr = array(
|
||||
"appid" => $this->config['app_id'],
|
||||
"secret" => $this->config['app_secret'],
|
||||
"code" => $code,
|
||||
"grant_type" => "authorization_code",
|
||||
);
|
||||
$response = Http::post(self::GET_ACCESS_TOKEN_URL, $queryarr);
|
||||
$ret = json_decode($response, TRUE);
|
||||
return $ret ? $ret : [];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\library;
|
||||
|
||||
use fast\Http;
|
||||
use think\Config;
|
||||
use think\Session;
|
||||
|
||||
/**
|
||||
* 微博
|
||||
*/
|
||||
class Weibo
|
||||
{
|
||||
|
||||
const GET_AUTH_CODE_URL = "https://api.weibo.com/oauth2/authorize";
|
||||
const GET_ACCESS_TOKEN_URL = "https://api.weibo.com/oauth2/access_token";
|
||||
const GET_USERINFO_URL = "https://api.weibo.com/2/users/show.json";
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
* @var array
|
||||
*/
|
||||
private $config = [];
|
||||
|
||||
public function __construct($options = [])
|
||||
{
|
||||
if ($config = Config::get('third.weibo'))
|
||||
{
|
||||
$this->config = array_merge($this->config, $config);
|
||||
}
|
||||
$this->config = array_merge($this->config, is_array($options) ? $options : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
header("Location:" . $this->getAuthorizeUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取authorize_url
|
||||
*/
|
||||
public function getAuthorizeUrl()
|
||||
{
|
||||
$state = md5(uniqid(rand(), TRUE));
|
||||
Session::set('state', $state);
|
||||
$queryarr = array(
|
||||
"response_type" => "code",
|
||||
"client_id" => $this->config['app_id'],
|
||||
"redirect_uri" => $this->config['callback'],
|
||||
"state" => $state,
|
||||
);
|
||||
request()->isMobile() && $queryarr['display'] = 'mobile';
|
||||
$url = self::GET_AUTH_CODE_URL . '?' . http_build_query($queryarr);
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getUserInfo($params = [])
|
||||
{
|
||||
$params = $params ? $params : $_GET;
|
||||
if (isset($params['access_token']) || (isset($params['state']) && $params['state'] == Session::get('state') && isset($params['code'])))
|
||||
{
|
||||
//获取access_token
|
||||
$data = isset($params['code']) ? $this->getAccessToken($params['code']) : $params;
|
||||
$access_token = isset($data['access_token']) ? $data['access_token'] : '';
|
||||
$refresh_token = isset($data['refresh_token']) ? $data['refresh_token'] : '';
|
||||
$expires_in = isset($data['expires_in']) ? $data['expires_in'] : 0;
|
||||
if ($access_token)
|
||||
{
|
||||
$uid = isset($data['uid']) ? $data['uid'] : '';
|
||||
//获取用户信息
|
||||
$queryarr = [
|
||||
"access_token" => $access_token,
|
||||
"uid" => $uid,
|
||||
];
|
||||
$ret = Http::get(self::GET_USERINFO_URL, $queryarr);
|
||||
$userinfo = json_decode($ret, TRUE);
|
||||
if (!$userinfo || isset($userinfo['error_code']))
|
||||
return [];
|
||||
$userinfo = $userinfo ? $userinfo : [];
|
||||
$userinfo['nickname'] = isset($userinfo['screen_name']) ? $userinfo['screen_name'] : '';
|
||||
$userinfo['avatar'] = isset($userinfo['profile_image_url']) ? $userinfo['profile_image_url'] : '';
|
||||
$data = [
|
||||
'access_token' => $access_token,
|
||||
'refresh_token' => $refresh_token,
|
||||
'expires_in' => $expires_in,
|
||||
'openid' => $uid,
|
||||
'userinfo' => $userinfo
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取access_token
|
||||
* @param string code
|
||||
* @return array
|
||||
*/
|
||||
private function getAccessToken($code = '')
|
||||
{
|
||||
if (!$code)
|
||||
return '';
|
||||
$queryarr = array(
|
||||
"grant_type" => "authorization_code",
|
||||
"client_id" => $this->config['app_id'],
|
||||
"client_secret" => $this->config['app_secret'],
|
||||
"redirect_uri" => $this->config['callback'],
|
||||
"code" => $code,
|
||||
);
|
||||
$response = Http::post(self::GET_ACCESS_TOKEN_URL, $queryarr);
|
||||
$ret = json_decode($response, TRUE);
|
||||
return $ret ? $ret : [];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace addons\third\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 会员模型
|
||||
*/
|
||||
class Third Extends Model
|
||||
{
|
||||
|
||||
// 开启自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
];
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\company;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 店铺设置
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Companyset extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* CompanySet模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('CompanySet');
|
||||
$this->view->assign("companyscaledataList", $this->model->getCompanyscaledataList());
|
||||
$this->view->assign("companresourcesdataList", $this->model->getCompanresourcesdataList());
|
||||
$this->view->assign("offlinestoredataList", $this->model->getOfflinestoredataList());
|
||||
$this->view->assign("cooperationplatformdataList", $this->model->getCooperationplatformdataList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\general;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use Cron\CronExpression;
|
||||
|
||||
/**
|
||||
* 定时任务
|
||||
*
|
||||
* @icon fa fa-tasks
|
||||
* @remark 类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell
|
||||
*/
|
||||
class Crontab extends Backend
|
||||
{
|
||||
|
||||
protected $model = null;
|
||||
protected $noNeedRight = ['check_schedule', 'get_schedule_future'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('Crontab');
|
||||
$this->view->assign('typedata', \app\common\model\Crontab::getTypeList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isAjax())
|
||||
{
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
$total = $this->model
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->count();
|
||||
|
||||
$list = $this->model
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->limit($offset, $limit)
|
||||
->select();
|
||||
foreach ($list as $k => &$v)
|
||||
{
|
||||
$cron = CronExpression::factory($v['schedule']);
|
||||
$v['nexttime'] = $cron->getNextRunDate()->getTimestamp();
|
||||
}
|
||||
$result = array("total" => $total, "rows" => $list);
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断Crontab格式是否正确
|
||||
* @internal
|
||||
*/
|
||||
public function check_schedule()
|
||||
{
|
||||
$row = $this->request->post("row/a");
|
||||
$schedule = isset($row['schedule']) ? $row['schedule'] : '';
|
||||
if (CronExpression::isValidExpression($schedule))
|
||||
{
|
||||
return json(['ok' => '']);
|
||||
}
|
||||
else
|
||||
{
|
||||
return json(['error' => __('Crontab format invalid')]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据Crontab表达式读取未来七次的时间
|
||||
* @internal
|
||||
*/
|
||||
public function get_schedule_future()
|
||||
{
|
||||
$time = [];
|
||||
$schedule = $this->request->post('schedule');
|
||||
$days = (int) $this->request->post('days');
|
||||
try
|
||||
{
|
||||
$cron = CronExpression::factory($schedule);
|
||||
for ($i = 0; $i < $days; $i++)
|
||||
{
|
||||
$time[] = $cron->getNextRunDate(null, $i)->format('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return json(['futuretime' => $time]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\order;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 订单主管理
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Order extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Order模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('Order');
|
||||
$this->view->assign("orderStatusList", $this->model->getOrderStatusList());
|
||||
$this->view->assign("commentStatusList", $this->model->getCommentStatusList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* NEW出行信息模板
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Newtravel extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* NewTravel模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('NewTravel');
|
||||
$this->view->assign("typeslistList", $this->model->getTypeslistList());
|
||||
$this->view->assign("travelersnumberdataList", $this->model->getTravelersnumberdataList());
|
||||
$this->view->assign("travelerinformationdataList", $this->model->getTravelerinformationdataList());
|
||||
$this->view->assign("tripinformationdataList", $this->model->getTripinformationdataList());
|
||||
$this->view->assign("backaddressdataList", $this->model->getBackaddressdataList());
|
||||
$this->view->assign("receivingaddressdataList", $this->model->getReceivingaddressdataList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 取还地址管理
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productaddress extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductAddress模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductAddress');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 接送机
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productairport extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductAirport模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductAirport');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 包车/拼车
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productcar extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductCar模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductCar');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 租车
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productcarrental extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductCarRental模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductCarRental');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 一日游
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productday extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductDay模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductDay');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 当地体验
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productexperience extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductExperience模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductExperience');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("outDataList", $this->model->getOutDataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 美食
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productfood extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductFood模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductFood');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 酒店套餐
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Producthotels extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductHotels模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductHotels');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("outDataList", $this->model->getOutDataList());
|
||||
$this->view->assign("hotelListList", $this->model->getHotelListList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 当地定制
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productlocal extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductLocal模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductLocal');
|
||||
$this->view->assign("outDataList", $this->model->getOutDataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 多日游
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productmanydays extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductManydays模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductManydays');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("outDataList", $this->model->getOutDataList());
|
||||
$this->view->assign("hotelListList", $this->model->getHotelListList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 演出展览
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Productshow extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductShow模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductShow');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("outDataList", $this->model->getOutDataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 景点门票
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Producttickets extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductTickets模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductTickets');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 交通卡/劵
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Producttraffic extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ProductTraffic模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('ProductTraffic');
|
||||
$this->view->assign("advancedataList", $this->model->getAdvancedataList());
|
||||
$this->view->assign("outDataList", $this->model->getOutDataList());
|
||||
$this->view->assign("listList", $this->model->getListList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Name' => '公司全称',
|
||||
'Storename' => '店铺名称',
|
||||
'Storeavatar' => '店铺LOGO',
|
||||
'Serveavatar' => '客服头像',
|
||||
'Companyscaledata' => '公司规模',
|
||||
'Companyscaledata 1' => '少于10人',
|
||||
'Companyscaledata 2' => '10-99人',
|
||||
'Companyscaledata 3' => '100-299人',
|
||||
'Companyscaledata 4' => '300-499人',
|
||||
'Companyscaledata 5' => '500人以上',
|
||||
'Companytime' => '公司成立日期',
|
||||
'Companyaddress' => '公司主要办公地址所在地',
|
||||
'Companyhttp' => '官网链接',
|
||||
'Companresourcesdata' => '公司自有的当地旅行资源',
|
||||
'Companresourcesdata 1' => '机票',
|
||||
'Companresourcesdata 2' => '酒店',
|
||||
'Companresourcesdata 3' => '景点门票',
|
||||
'Companresourcesdata 4' => '车',
|
||||
'Companresourcesdata 5' => '导游',
|
||||
'Companresourcesdata 6' => '交通票劵',
|
||||
'Companresourcesdata 7' => '餐饮',
|
||||
'Companresourcesdata 8' => '无',
|
||||
'Companresourcesdata 9' => '其他',
|
||||
'Resourcessuperiority' => '独家资源优势',
|
||||
'Offlinestoredata' => '线下是否有门店',
|
||||
'Offlinestoredata 1' => '无门店',
|
||||
'Offlinestoredata 2' => '1家',
|
||||
'Offlinestoredata 3' => '2-5家',
|
||||
'Offlinestoredata 4' => '6-10家',
|
||||
'Offlinestoredata 5' => '11-20家',
|
||||
'Offlinestoredata 6' => '20家以上',
|
||||
'Cooperationplatformdata' => '目前合作过的电商平台',
|
||||
'Cooperationplatformdata 1' => '携程',
|
||||
'Cooperationplatformdata 2' => '飞猪',
|
||||
'Cooperationplatformdata 3' => '去哪儿',
|
||||
'Cooperationplatformdata 4' => '穷游',
|
||||
'Cooperationplatformdata 5' => '途牛',
|
||||
'Cooperationplatformdata 6' => '同城',
|
||||
'Cooperationplatformdata 7' => '驴妈妈',
|
||||
'Cooperationplatformdata 8' => '美团',
|
||||
'Cooperationplatformdata 9' => '无',
|
||||
'Cooperationplatformdata 10' => '其他'
|
||||
];
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Title' => '任务标题',
|
||||
'Maximums' => '最多执行',
|
||||
'Sleep' => '延迟秒数',
|
||||
'Schedule' => '执行周期',
|
||||
'Executes' => '执行次数',
|
||||
'No limit' => '无限制',
|
||||
'Execute time' => '最后执行时间',
|
||||
'Request Url' => '请求URL',
|
||||
'Execute Sql Script' => '执行SQL',
|
||||
'Execute Shell' => '执行Shell',
|
||||
'Crontab format invalid' => 'Crontab格式错误',
|
||||
'Next execute time' => '下次预计时间',
|
||||
'The next %s times the execution time' => '接下来 %s 次的执行时间',
|
||||
];
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'User_id' => '关联user表 用户id',
|
||||
'Order_num' => '订单编号',
|
||||
'Order_status' => '订单状态',
|
||||
'Order_status 0' => '未支付',
|
||||
'Order_status 1' => '已支付',
|
||||
'Travel_start_time' => '出行日期',
|
||||
'Travel_end_time' => '结束日期',
|
||||
'Product_name' => '产品名称',
|
||||
'Comment_status' => '点评状态',
|
||||
'Comment_status 0' => '未点评',
|
||||
'Comment_status 1' => '已点评',
|
||||
'Order_start_time' => '订单生成起始日期',
|
||||
'Total_num' => '订单金额',
|
||||
'Already_rechage_num' => '已付金额',
|
||||
'Notice' => '通知TODO',
|
||||
'Reconciliation_time' => '对账时间',
|
||||
'Buy_detail' => '购买详情',
|
||||
'Reduction_strategy' => '减价策略',
|
||||
'Ota_name' => 'OTA产品名称',
|
||||
'Pay_id' => '主支付信息id',
|
||||
'Supplier_id' => '供应商'
|
||||
];
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'id',
|
||||
'Traveltext' => '模版名称',
|
||||
'Typeslist' => '模版适应类型',
|
||||
'Typeslist 1' => '全部',
|
||||
'Typeslist 2' => '机+酒',
|
||||
'Typeslist 3' => '特价机票',
|
||||
'Typeslist 4' => '半自助',
|
||||
'Typeslist 5' => '跟团',
|
||||
'Typeslist 6' => '景点门票',
|
||||
'Typeslist 7' => '一日游',
|
||||
'Typeslist 8' => '多日游',
|
||||
'Typeslist 9' => '当地订制',
|
||||
'Typeslist 10' => '酒店套餐',
|
||||
'Typeslist 11' => '演出展览',
|
||||
'Typeslist 12' => '当地体验',
|
||||
'Typeslist 13' => '美食',
|
||||
'Typeslist 14' => '接送机',
|
||||
'Typeslist 15' => '包车/拼车',
|
||||
'Typeslist 16' => '交通卡/劵',
|
||||
'Typeslist 17' => '租车',
|
||||
'Typeslist 18' => '签证',
|
||||
'Typeslist 19' => 'WIFI',
|
||||
'Typeslist 20' => '电话卡',
|
||||
'Typeslist 21' => '保险',
|
||||
'Typeslist 22' => '自由行定制',
|
||||
'Typeslist 23' => '游轮',
|
||||
'Typeslist 24' => '打折劵',
|
||||
'Typeslist 25' => '购物',
|
||||
'Travelersnumberdata' => '出行人信息',
|
||||
'Travelersnumberdata 1' => '一个人',
|
||||
'Travelersnumberdata 2' => '多人出行(仅出行人信息需要填写多份)',
|
||||
'Travelerinformationdata' => '出行人信息',
|
||||
'Travelerinformationdata 1' => '中文姓名',
|
||||
'Travelerinformationdata 2' => '姓(拼音)',
|
||||
'Travelerinformationdata 3' => '名(拼音)',
|
||||
'Travelerinformationdata 4' => '证件类型',
|
||||
'Travelerinformationdata 5' => '有效期',
|
||||
'Travelerinformationdata 6' => '出生日期',
|
||||
'Travelerinformationdata 7' => '性别',
|
||||
'Travelerinformationdata 8' => '国籍',
|
||||
'Travelerinformationdata 9' => '联系电话',
|
||||
'Travelerinformationdata 10' => '身高(cm)',
|
||||
'Travelerinformationdata 11' => '体重(kg)',
|
||||
'Travelerinformationdata 12' => '鞋码(欧码)',
|
||||
'Travelerinformationdata 13' => '左眼视力',
|
||||
'Travelerinformationdata 14' => '右眼视力',
|
||||
'Tripinformationdata' => '行程信息',
|
||||
'Tripinformationdata 1' => '境外联系电话',
|
||||
'Tripinformationdata 2' => '微信号',
|
||||
'Tripinformationdata 3' => '预约时间',
|
||||
'Tripinformationdata 4' => '出行人数',
|
||||
'Tripinformationdata 5' => '行李数',
|
||||
'Tripinformationdata 6' => '接人时间',
|
||||
'Tripinformationdata 7' => '接人地点',
|
||||
'Tripinformationdata 8' => '接人地点(英文)',
|
||||
'Tripinformationdata 9' => '送达地点',
|
||||
'Tripinformationdata 10' => '送达地点(英文)',
|
||||
'Tripinformationdata 11' => '接人酒店名称',
|
||||
'Tripinformationdata 12' => '接人酒店地址',
|
||||
'Tripinformationdata 13' => '接人酒店名称(英文)',
|
||||
'Tripinformationdata 14' => '接人酒店地址(英文)',
|
||||
'Tripinformationdata 15' => '接人酒店电话',
|
||||
'Tripinformationdata 16' => '接机航班号',
|
||||
'Tripinformationdata 17' => '航班抵达日期',
|
||||
'Tripinformationdata 18' => '航班抵达时间',
|
||||
'Tripinformationdata 19' => '送达酒店名称',
|
||||
'Tripinformationdata 20' => '送达酒店地址',
|
||||
'Tripinformationdata 21' => '送达酒店名称(英文)',
|
||||
'Tripinformationdata 22' => '送达酒店地址(英文)',
|
||||
'Tripinformationdata 23' => '送达酒店电话',
|
||||
'Tripinformationdata 24' => '送机航班号',
|
||||
'Tripinformationdata 25' => '航班起飞日期',
|
||||
'Tripinformationdata 26' => '航班起飞时间',
|
||||
'Tripinformationdata 27' => '出发酒店名称(英文)',
|
||||
'Tripinformationdata 28' => '出发酒店名称(中文)',
|
||||
'Tripinformationdata 29' => '出发酒店地址(英文)',
|
||||
'Tripinformationdata 30' => '出发酒店电话',
|
||||
'Tripinformationdata 31' => '接送酒店名称(英文)',
|
||||
'Tripinformationdata 32' => '接送酒店地址(英文)',
|
||||
'Tripinformationdata 33' => '接送酒店电话',
|
||||
'Tripinformationdata 34' => '过夜酒店名称(英文)',
|
||||
'Tripinformationdata 35' => '过夜酒店地址(英文)',
|
||||
'Tripinformationdata 36' => '用车时间',
|
||||
'Tripinformationdata 37' => '用车地点',
|
||||
'Tripinformationdata 38' => '接机/送机航班号',
|
||||
'Tripinformationdata 39' => '降落/起飞时间',
|
||||
'Tripinformationdata 40' => '接人/送达地点',
|
||||
'Tripinformationdata 41' => '用车人数',
|
||||
'Tripinformationdata 42' => '返回酒店名称(英文)',
|
||||
'Tripinformationdata 43' => '返回酒店地址(英文)',
|
||||
'Tripinformationdata 44' => '返回酒店电话',
|
||||
'Tripinformationdata 45' => '行程计划',
|
||||
'Tripinformationdata 46' => '返程送回酒店名称(英文)',
|
||||
'Tripinformationdata 47' => '返程送回酒店地址(英文)',
|
||||
'Tripinformationdata 48' => '返程送回酒店电话',
|
||||
'Tripinformationdata 49' => '酒店名称(英文)',
|
||||
'Tripinformationdata 50' => '酒店地址(英文)',
|
||||
'Tripinformationdata 51' => '酒店联系电话',
|
||||
'Tripinformationdata 52' => '入住酒店日期',
|
||||
'Tripinformationdata 53' => '离开酒店日期',
|
||||
'Tripinformationdata 54' => '返程航班号/火车列次',
|
||||
'Tripinformationdata 55' => '返程日期',
|
||||
'Tripinformationdata 56' => '返程航班/列次时间',
|
||||
'Tripinformationdata 57' => '取还设备地址',
|
||||
'Tripinformationdata 58' => '预计出行日期',
|
||||
'Tripinformationdata 59' => '到达火车车次',
|
||||
'Tripinformationdata 60' => '到达车站',
|
||||
'Tripinformationdata 61' => '出发时间(单选)',
|
||||
'Tripinformationdata 62' => '出发班次',
|
||||
'Tripinformationdata 63' => '出发酒店所在区域',
|
||||
'Tripinformationdata 64' => '用餐时间',
|
||||
'Backaddressdata' => '取还地址',
|
||||
'Backaddressdata 1' => '取件地址',
|
||||
'Backaddressdata 2' => '还回地址',
|
||||
'Receivingaddressdata' => '收货地址',
|
||||
'Receivingaddressdata 1' => '收货人姓名',
|
||||
'Receivingaddressdata 2' => '收货人电话',
|
||||
'Receivingaddressdata 3' => '收货地址'
|
||||
];
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'City' => '取件城市 ',
|
||||
'Airport' => '机场',
|
||||
'Terminal' => '航站楼',
|
||||
'Place' => '地点',
|
||||
'Username' => '姓名',
|
||||
'Tel' => '电话',
|
||||
'Opentime' => '开始营业时间',
|
||||
'Closetime' => '结束营业时间'
|
||||
];
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app减价',
|
||||
'Startdate' => '减价开始时间',
|
||||
'Enddate' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线',
|
||||
'Status' => '状态'
|
||||
];
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Topimages' => '轮播图',
|
||||
'Videofiles' => '头图视频',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Trip_length' => '行程时间',
|
||||
'Trip_theme' => '该时间段的行程主题',
|
||||
'Images' => '添加该时间段的行程活动相关图片',
|
||||
'Infomation' => '对该时段内行程的描述',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Images' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Out_postion' => '出发地',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Trip_length' => '行程时间',
|
||||
'Trip_theme' => '该时间段的行程主题',
|
||||
'Images' => '添加该时间段的行程活动相关图片',
|
||||
'Infomation' => '对该时段内行程的描述',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Topimages' => '轮播图',
|
||||
'Videofiles' => '头图视频',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Out_data' => '行程天数',
|
||||
'Out_data 0' => '1天',
|
||||
'Out_data 1' => '2天',
|
||||
'Out_data 2' => '3天',
|
||||
'Out_data 3' => '4天',
|
||||
'Out_data 4' => '5天',
|
||||
'Out_data 5' => '6天',
|
||||
'Out_data 6' => '7天',
|
||||
'Out_data 7' => '8天',
|
||||
'Out_data 8' => '9天',
|
||||
'Out_data 9' => '10天',
|
||||
'Out_data 10' => '11天',
|
||||
'Out_data 11' => '12天',
|
||||
'Out_data 12' => '13天',
|
||||
'Out_data 13' => '14天',
|
||||
'Out_data 14' => '15天',
|
||||
'Out_data 15' => '15天以上',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Trip_length' => '行程时间',
|
||||
'Trip_theme' => '该时间段的行程主题',
|
||||
'Images' => '添加该时间段的行程活动相关图片',
|
||||
'Infomation' => '对该时段内行程的描述',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Images' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Out_data' => '行程天数',
|
||||
'Out_data 0' => '1天',
|
||||
'Out_data 1' => '2天',
|
||||
'Out_data 2' => '3天',
|
||||
'Out_data 3' => '4天',
|
||||
'Out_data 4' => '5天',
|
||||
'Out_data 5' => '6天',
|
||||
'Out_data 6' => '7天',
|
||||
'Out_data 7' => '8天',
|
||||
'Out_data 8' => '9天',
|
||||
'Out_data 9' => '10天',
|
||||
'Out_data 10' => '11天',
|
||||
'Out_data 11' => '12天',
|
||||
'Out_data 12' => '13天',
|
||||
'Out_data 13' => '14天',
|
||||
'Out_data 14' => '15天',
|
||||
'Out_data 15' => '15天以上',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Hotel_id' => '酒店ID',
|
||||
'Hotel_name' => '酒店名称',
|
||||
'Hotel_en_name' => '英文名称',
|
||||
'Hotel_list' => '前台显示',
|
||||
'Hotel_list 0' => '不显示',
|
||||
'Hotel_list 1' => '显示',
|
||||
'Hotel_address' => '酒店地址',
|
||||
'Hotel_info' => '酒店简介',
|
||||
'Hotel_images' => '酒店图片',
|
||||
'Trip_length' => '行程时间',
|
||||
'Trip_theme' => '该时间段的行程主题',
|
||||
'Images' => '添加该时间段的行程活动相关图片',
|
||||
'Infomation' => '对该时段内行程的描述',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Image' => '首页轮播图',
|
||||
'Topimages' => '更多轮播图',
|
||||
'Videofiles' => '头图视频',
|
||||
'Price_id' => '参考价格关联ID',
|
||||
'Explanation' => '预订说明',
|
||||
'Outlocal' => '出发地',
|
||||
'Out_postion' => '出发地',
|
||||
'Out_data' => '行程天数',
|
||||
'Out_data 0' => '1天',
|
||||
'Out_data 1' => '2天',
|
||||
'Out_data 2' => '3天',
|
||||
'Out_data 3' => '4天',
|
||||
'Out_data 4' => '5天',
|
||||
'Out_data 5' => '6天',
|
||||
'Out_data 6' => '7天',
|
||||
'Out_data 7' => '8天',
|
||||
'Out_data 8' => '9天',
|
||||
'Out_data 9' => '10天',
|
||||
'Out_data 10' => '11天',
|
||||
'Out_data 11' => '12天',
|
||||
'Out_data 12' => '13天',
|
||||
'Out_data 13' => '14天',
|
||||
'Out_data 14' => '15天',
|
||||
'Out_data 15' => '15天以上',
|
||||
'Supplier' => '产品提供商',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Trip_length' => '行程时间',
|
||||
'Trip_theme' => '该时间段的行程主题',
|
||||
'Images' => '添加该时间段的行程活动相关图片',
|
||||
'Infomation' => '对该时段内行程的描述',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Out_postion' => '出发地',
|
||||
'Out_data' => '行程天数',
|
||||
'Out_data 0' => '1天',
|
||||
'Out_data 1' => '2天',
|
||||
'Out_data 2' => '3天',
|
||||
'Out_data 3' => '4天',
|
||||
'Out_data 4' => '5天',
|
||||
'Out_data 5' => '6天',
|
||||
'Out_data 6' => '7天',
|
||||
'Out_data 7' => '8天',
|
||||
'Out_data 8' => '9天',
|
||||
'Out_data 9' => '10天',
|
||||
'Out_data 10' => '11天',
|
||||
'Out_data 11' => '12天',
|
||||
'Out_data 12' => '13天',
|
||||
'Out_data 13' => '14天',
|
||||
'Out_data 14' => '15天',
|
||||
'Out_data 15' => '15天以上',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Hotel_id' => '酒店ID',
|
||||
'Hotel_name' => '酒店名称',
|
||||
'Hotel_en_name' => '英文名称',
|
||||
'Hotel_list' => '前台显示',
|
||||
'Hotel_list 0' => '不显示',
|
||||
'Hotel_list 1' => '显示',
|
||||
'Hotel_address' => '酒店地址',
|
||||
'Hotel_info' => '酒店简介',
|
||||
'Hotel_images' => '酒店图片',
|
||||
'Trip_length' => '行程时间',
|
||||
'Trip_theme' => '该时间段的行程主题',
|
||||
'Images' => '添加该时间段的行程活动相关图片',
|
||||
'Infomation' => '对该时段内行程的描述',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线',
|
||||
'Status' => '状态'
|
||||
];
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Videofiles' => '头图视频',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Out_data' => '行程天数',
|
||||
'Out_data 0' => '1天',
|
||||
'Out_data 1' => '2天',
|
||||
'Out_data 2' => '3天',
|
||||
'Out_data 3' => '4天',
|
||||
'Out_data 4' => '5天',
|
||||
'Out_data 5' => '6天',
|
||||
'Out_data 6' => '7天',
|
||||
'Out_data 7' => '8天',
|
||||
'Out_data 8' => '9天',
|
||||
'Out_data 9' => '10天',
|
||||
'Out_data 10' => '11天',
|
||||
'Out_data 11' => '12天',
|
||||
'Out_data 12' => '13天',
|
||||
'Out_data 13' => '14天',
|
||||
'Out_data 14' => '15天',
|
||||
'Out_data 15' => '15天以上',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Hotel_id' => '关联hotel信息表',
|
||||
'Trip_id' => '关联行程信息表',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'Category_id' => '分类ID(单选)',
|
||||
'Status' => '状态',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Name' => '产品名称(中文)',
|
||||
'Lightwords' => '亮点词',
|
||||
'Destination' => '目的地',
|
||||
'Homeimages' => '轮播图',
|
||||
'Cost_production' => '产品原价',
|
||||
'Advancedata' => '提前预定',
|
||||
'Advancedata 0' => '无',
|
||||
'Advancedata 1' => '可定今日',
|
||||
'Advancedata 2' => '可定明日',
|
||||
'Advancedata 3' => '提前预订',
|
||||
'Explanation' => '预订说明',
|
||||
'Travel_template_information' => '出行模板信息',
|
||||
'Out_data' => '行程天数',
|
||||
'Out_data 0' => '1天',
|
||||
'Out_data 1' => '2天',
|
||||
'Out_data 2' => '3天',
|
||||
'Out_data 3' => '4天',
|
||||
'Out_data 4' => '5天',
|
||||
'Out_data 5' => '6天',
|
||||
'Out_data 6' => '7天',
|
||||
'Out_data 7' => '8天',
|
||||
'Out_data 8' => '9天',
|
||||
'Out_data 9' => '10天',
|
||||
'Out_data 10' => '11天',
|
||||
'Out_data 11' => '12天',
|
||||
'Out_data 12' => '13天',
|
||||
'Out_data 13' => '14天',
|
||||
'Out_data 14' => '15天',
|
||||
'Out_data 15' => '15天以上',
|
||||
'Supplier' => '产品提供商',
|
||||
'Supplier_price' => '供应商app限时减价',
|
||||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
'In_stock' => '库存',
|
||||
'List' => '状态',
|
||||
'List 0' => '未上线',
|
||||
'List 1' => '已上线',
|
||||
'List 2' => '人工下线',
|
||||
'List 3' => '系统下线',
|
||||
'List 4' => '审核下线'
|
||||
];
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class CompanySet extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'company_set';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'companyscaledata_text',
|
||||
'companresourcesdata_text',
|
||||
'offlinestoredata_text',
|
||||
'cooperationplatformdata_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getCompanyscaledataList()
|
||||
{
|
||||
return ['1' => __('Companyscaledata 1'),'2' => __('Companyscaledata 2'),'3' => __('Companyscaledata 3'),'4' => __('Companyscaledata 4'),'5' => __('Companyscaledata 5')];
|
||||
}
|
||||
|
||||
public function getCompanresourcesdataList()
|
||||
{
|
||||
return ['1' => __('Companresourcesdata 1'),'2' => __('Companresourcesdata 2'),'3' => __('Companresourcesdata 3'),'4' => __('Companresourcesdata 4'),'5' => __('Companresourcesdata 5'),'6' => __('Companresourcesdata 6'),'7' => __('Companresourcesdata 7'),'8' => __('Companresourcesdata 8'),'9' => __('Companresourcesdata 9')];
|
||||
}
|
||||
|
||||
public function getOfflinestoredataList()
|
||||
{
|
||||
return ['1' => __('Offlinestoredata 1'),'2' => __('Offlinestoredata 2'),'3' => __('Offlinestoredata 3'),'4' => __('Offlinestoredata 4'),'5' => __('Offlinestoredata 5'),'6' => __('Offlinestoredata 6')];
|
||||
}
|
||||
|
||||
public function getCooperationplatformdataList()
|
||||
{
|
||||
return ['1' => __('Cooperationplatformdata 1'),'2' => __('Cooperationplatformdata 2'),'3' => __('Cooperationplatformdata 3'),'4' => __('Cooperationplatformdata 4'),'5' => __('Cooperationplatformdata 5'),'6' => __('Cooperationplatformdata 6'),'7' => __('Cooperationplatformdata 7'),'8' => __('Cooperationplatformdata 8'),'9' => __('Cooperationplatformdata 9'),'10' => __('Cooperationplatformdata 10')];
|
||||
}
|
||||
|
||||
|
||||
public function getCompanyscaledataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['companyscaledata'];
|
||||
$list = $this->getCompanyscaledataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getCompanresourcesdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['companresourcesdata'];
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getCompanresourcesdataList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getOfflinestoredataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['offlinestoredata'];
|
||||
$list = $this->getOfflinestoredataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getCooperationplatformdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['cooperationplatformdata'];
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getCooperationplatformdataList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
protected function setCompanresourcesdataAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
protected function setCooperationplatformdataAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class NewTravel extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'new_travel';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'typeslist_text',
|
||||
'travelersnumberdata_text',
|
||||
'travelerinformationdata_text',
|
||||
'tripinformationdata_text',
|
||||
'backaddressdata_text',
|
||||
'receivingaddressdata_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeslistList()
|
||||
{
|
||||
return ['1' => __('Typeslist 1'),'2' => __('Typeslist 2'),'3' => __('Typeslist 3'),'4' => __('Typeslist 4'),'5' => __('Typeslist 5'),'6' => __('Typeslist 6'),'7' => __('Typeslist 7'),'8' => __('Typeslist 8'),'9' => __('Typeslist 9'),'10' => __('Typeslist 10'),'11' => __('Typeslist 11'),'12' => __('Typeslist 12'),'13' => __('Typeslist 13'),'14' => __('Typeslist 14'),'15' => __('Typeslist 15'),'16' => __('Typeslist 16'),'17' => __('Typeslist 17'),'18' => __('Typeslist 18'),'19' => __('Typeslist 19'),'20' => __('Typeslist 20'),'21' => __('Typeslist 21'),'22' => __('Typeslist 22'),'23' => __('Typeslist 23'),'24' => __('Typeslist 24'),'25' => __('Typeslist 25')];
|
||||
}
|
||||
|
||||
public function getTravelersnumberdataList()
|
||||
{
|
||||
return ['1' => __('Travelersnumberdata 1'),'2' => __('Travelersnumberdata 2')];
|
||||
}
|
||||
|
||||
public function getTravelerinformationdataList()
|
||||
{
|
||||
return ['1' => __('Travelerinformationdata 1'),'2' => __('Travelerinformationdata 2'),'3' => __('Travelerinformationdata 3'),'4' => __('Travelerinformationdata 4'),'5' => __('Travelerinformationdata 5'),'6' => __('Travelerinformationdata 6'),'7' => __('Travelerinformationdata 7'),'8' => __('Travelerinformationdata 8'),'9' => __('Travelerinformationdata 9'),'10' => __('Travelerinformationdata 10'),'11' => __('Travelerinformationdata 11'),'12' => __('Travelerinformationdata 12'),'13' => __('Travelerinformationdata 13'),'14' => __('Travelerinformationdata 14')];
|
||||
}
|
||||
|
||||
public function getTripinformationdataList()
|
||||
{
|
||||
return ['1' => __('Tripinformationdata 1'),'2' => __('Tripinformationdata 2'),'3' => __('Tripinformationdata 3'),'4' => __('Tripinformationdata 4'),'5' => __('Tripinformationdata 5'),'6' => __('Tripinformationdata 6'),'7' => __('Tripinformationdata 7'),'8' => __('Tripinformationdata 8'),'9' => __('Tripinformationdata 9'),'10' => __('Tripinformationdata 10'),'11' => __('Tripinformationdata 11'),'12' => __('Tripinformationdata 12'),'13' => __('Tripinformationdata 13'),'14' => __('Tripinformationdata 14'),'15' => __('Tripinformationdata 15'),'16' => __('Tripinformationdata 16'),'17' => __('Tripinformationdata 17'),'18' => __('Tripinformationdata 18'),'19' => __('Tripinformationdata 19'),'20' => __('Tripinformationdata 20'),'21' => __('Tripinformationdata 21'),'22' => __('Tripinformationdata 22'),'23' => __('Tripinformationdata 23'),'24' => __('Tripinformationdata 24'),'25' => __('Tripinformationdata 25'),'26' => __('Tripinformationdata 26'),'27' => __('Tripinformationdata 27'),'28' => __('Tripinformationdata 28'),'29' => __('Tripinformationdata 29'),'30' => __('Tripinformationdata 30'),'31' => __('Tripinformationdata 31'),'32' => __('Tripinformationdata 32'),'33' => __('Tripinformationdata 33'),'34' => __('Tripinformationdata 34'),'35' => __('Tripinformationdata 35'),'36' => __('Tripinformationdata 36'),'37' => __('Tripinformationdata 37'),'38' => __('Tripinformationdata 38'),'39' => __('Tripinformationdata 39'),'40' => __('Tripinformationdata 40'),'41' => __('Tripinformationdata 41'),'42' => __('Tripinformationdata 42'),'43' => __('Tripinformationdata 43'),'44' => __('Tripinformationdata 44'),'45' => __('Tripinformationdata 45'),'46' => __('Tripinformationdata 46'),'47' => __('Tripinformationdata 47'),'48' => __('Tripinformationdata 48'),'49' => __('Tripinformationdata 49'),'50' => __('Tripinformationdata 50'),'51' => __('Tripinformationdata 51'),'52' => __('Tripinformationdata 52'),'53' => __('Tripinformationdata 53'),'54' => __('Tripinformationdata 54'),'55' => __('Tripinformationdata 55'),'56' => __('Tripinformationdata 56'),'57' => __('Tripinformationdata 57'),'58' => __('Tripinformationdata 58'),'59' => __('Tripinformationdata 59'),'60' => __('Tripinformationdata 60'),'61' => __('Tripinformationdata 61'),'62' => __('Tripinformationdata 62'),'63' => __('Tripinformationdata 63'),'64' => __('Tripinformationdata 64')];
|
||||
}
|
||||
|
||||
public function getBackaddressdataList()
|
||||
{
|
||||
return ['1' => __('Backaddressdata 1'),'2' => __('Backaddressdata 2')];
|
||||
}
|
||||
|
||||
public function getReceivingaddressdataList()
|
||||
{
|
||||
return ['1' => __('Receivingaddressdata 1'),'2' => __('Receivingaddressdata 2'),'3' => __('Receivingaddressdata 3')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeslistTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['typeslist'];
|
||||
$list = $this->getTypeslistList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getTravelersnumberdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['travelersnumberdata'];
|
||||
$list = $this->getTravelersnumberdataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getTravelerinformationdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['travelerinformationdata'];
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getTravelerinformationdataList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getTripinformationdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['tripinformationdata'];
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getTripinformationdataList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getBackaddressdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['backaddressdata'];
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getBackaddressdataList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getReceivingaddressdataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['receivingaddressdata'];
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getReceivingaddressdataList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
protected function setTravelerinformationdataAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
protected function setTripinformationdataAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
protected function setBackaddressdataAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
protected function setReceivingaddressdataAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'order';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'order_status_text',
|
||||
'comment_status_text',
|
||||
'order_start_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getOrderStatusList()
|
||||
{
|
||||
return ['0' => __('Order_status 0'),'1' => __('Order_status 1')];
|
||||
}
|
||||
|
||||
public function getCommentStatusList()
|
||||
{
|
||||
return ['0' => __('Comment_status 0'),'1' => __('Comment_status 1')];
|
||||
}
|
||||
|
||||
|
||||
public function getOrderStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['order_status'];
|
||||
$list = $this->getOrderStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getCommentStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['comment_status'];
|
||||
$list = $this->getCommentStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getOrderStartTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['order_start_time'];
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setOrderStartTimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductAddress extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_address';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductAirport extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_airport';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'list_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Normal'),'hidden' => __('Hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['status'];
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductCar extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_car';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductCarRental extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_car_rental';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductDay extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_day';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductExperience extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_experience';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'out_data_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getOutDataList()
|
||||
{
|
||||
return ['0' => __('Out_data 0'),'1' => __('Out_data 1'),'2' => __('Out_data 2'),'3' => __('Out_data 3'),'4' => __('Out_data 4'),'5' => __('Out_data 5'),'6' => __('Out_data 6'),'7' => __('Out_data 7'),'8' => __('Out_data 8'),'9' => __('Out_data 9'),'10' => __('Out_data 10'),'11' => __('Out_data 11'),'12' => __('Out_data 12'),'13' => __('Out_data 13'),'14' => __('Out_data 14'),'15' => __('Out_data 15')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getOutDataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['out_data'];
|
||||
$list = $this->getOutDataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductFood extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_food';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductHotels extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_hotels';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'out_data_text',
|
||||
'hotel_list_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getOutDataList()
|
||||
{
|
||||
return ['0' => __('Out_data 0'),'1' => __('Out_data 1'),'2' => __('Out_data 2'),'3' => __('Out_data 3'),'4' => __('Out_data 4'),'5' => __('Out_data 5'),'6' => __('Out_data 6'),'7' => __('Out_data 7'),'8' => __('Out_data 8'),'9' => __('Out_data 9'),'10' => __('Out_data 10'),'11' => __('Out_data 11'),'12' => __('Out_data 12'),'13' => __('Out_data 13'),'14' => __('Out_data 14'),'15' => __('Out_data 15')];
|
||||
}
|
||||
|
||||
public function getHotelListList()
|
||||
{
|
||||
return ['0' => __('Hotel_list 0'),'1' => __('Hotel_list 1')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getOutDataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['out_data'];
|
||||
$list = $this->getOutDataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getHotelListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['hotel_list'];
|
||||
$list = $this->getHotelListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductLocal extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_local';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'out_data_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getOutDataList()
|
||||
{
|
||||
return ['0' => __('Out_data 0'),'1' => __('Out_data 1'),'2' => __('Out_data 2'),'3' => __('Out_data 3'),'4' => __('Out_data 4'),'5' => __('Out_data 5'),'6' => __('Out_data 6'),'7' => __('Out_data 7'),'8' => __('Out_data 8'),'9' => __('Out_data 9'),'10' => __('Out_data 10'),'11' => __('Out_data 11'),'12' => __('Out_data 12'),'13' => __('Out_data 13'),'14' => __('Out_data 14'),'15' => __('Out_data 15')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getOutDataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['out_data'];
|
||||
$list = $this->getOutDataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductManydays extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_manydays';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'out_data_text',
|
||||
'hotel_list_text',
|
||||
'list_text',
|
||||
'status_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getOutDataList()
|
||||
{
|
||||
return ['0' => __('Out_data 0'),'1' => __('Out_data 1'),'2' => __('Out_data 2'),'3' => __('Out_data 3'),'4' => __('Out_data 4'),'5' => __('Out_data 5'),'6' => __('Out_data 6'),'7' => __('Out_data 7'),'8' => __('Out_data 8'),'9' => __('Out_data 9'),'10' => __('Out_data 10'),'11' => __('Out_data 11'),'12' => __('Out_data 12'),'13' => __('Out_data 13'),'14' => __('Out_data 14'),'15' => __('Out_data 15')];
|
||||
}
|
||||
|
||||
public function getHotelListList()
|
||||
{
|
||||
return ['0' => __('Hotel_list 0'),'1' => __('Hotel_list 1')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Normal'),'hidden' => __('Hidden')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getOutDataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['out_data'];
|
||||
$list = $this->getOutDataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getHotelListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['hotel_list'];
|
||||
$list = $this->getHotelListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['status'];
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductShow extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_show';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'out_data_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getOutDataList()
|
||||
{
|
||||
return ['0' => __('Out_data 0'),'1' => __('Out_data 1'),'2' => __('Out_data 2'),'3' => __('Out_data 3'),'4' => __('Out_data 4'),'5' => __('Out_data 5'),'6' => __('Out_data 6'),'7' => __('Out_data 7'),'8' => __('Out_data 8'),'9' => __('Out_data 9'),'10' => __('Out_data 10'),'11' => __('Out_data 11'),'12' => __('Out_data 12'),'13' => __('Out_data 13'),'14' => __('Out_data 14'),'15' => __('Out_data 15')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getOutDataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['out_data'];
|
||||
$list = $this->getOutDataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class ProductTickets extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'product_tickets';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'advancedata_text',
|
||||
'status_text',
|
||||
'list_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getAdvancedataList()
|
||||
{
|
||||
return ['0' => __('Advancedata 0'),'1' => __('Advancedata 1'),'2' => __('Advancedata 2'),'3' => __('Advancedata 3')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['normal' => __('Normal'),'hidden' => __('Hidden')];
|
||||
}
|
||||
|
||||
public function getListList()
|
||||
{
|
||||
return ['0' => __('List 0'),'1' => __('List 1'),'2' => __('List 2'),'3' => __('List 3'),'4' => __('List 4')];
|
||||
}
|
||||
|
||||
|
||||
public function getAdvancedataTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['advancedata'];
|
||||
$list = $this->getAdvancedataList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['status'];
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getListTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['list'];
|
||||
$list = $this->getListList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue