mirror of https://gitee.com/karson/fastadmin.git
commit
453d7c5b55
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
<inspection_tool class="Jscs" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/fastadmin.iml" filepath="$PROJECT_DIR$/.idea/fastadmin.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -57,9 +57,8 @@ return array (
|
|||
'value' =>
|
||||
array (
|
||||
'register' => 'SMS_114000000',
|
||||
'resetpwd' => 'SMS_114000000',
|
||||
'resetpwd' => '',
|
||||
'changepwd' => 'SMS_114000000',
|
||||
'短信验证码' => 'SMS_119078242',
|
||||
),
|
||||
'rule' => 'required',
|
||||
'msg' => '',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\raiders;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
use think\Controller;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 攻略数据管理
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Raiders extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Raiders模型对象
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('Raiders');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -37,8 +37,6 @@ return [
|
|||
'Supplier_start' => '减价开始时间',
|
||||
'Supplier_end' => '减价结束时间',
|
||||
'Introductioncontent' => '产品介绍',
|
||||
'Hotel_id' => '关联hotel信息表',
|
||||
'Trip_id' => '关联行程信息表',
|
||||
'Descriptioncontent' => '费用说明',
|
||||
'Useinfocontent' => '使用说明',
|
||||
'Informationcontent' => '购买须知',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Num' => '攻略编号',
|
||||
'Title' => '标题',
|
||||
'City' => '目的地',
|
||||
'Lead_language' => '攻略导语',
|
||||
'Image' => '封面图片',
|
||||
'Status' => '状态',
|
||||
'Status 0' => '审核通过',
|
||||
'Status 1' => '未审核',
|
||||
'Create_time' => '创建日期',
|
||||
'Update_time' => '更新日期',
|
||||
'Read_num' => '阅读人数',
|
||||
'User_id' => '关联发表攻略个人ID'
|
||||
];
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Raiders extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'raiders';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'create_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getCreateTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['create_time'];
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function getUpdateTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : $data['update_time'];
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setCreateTimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
protected function setUpdateTimeAttr($value)
|
||||
{
|
||||
return $value && !is_numeric($value) ? strtotime($value) : $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Raiders extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
|
|
@ -7,13 +7,13 @@
|
|||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('order/order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('order/order/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('order/order/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('order/order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
<!-- <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('order/order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
|
||||
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('order/order/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('order/order/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>
|
||||
<!-- <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>
|
||||
|
|
|
|||
|
|
@ -118,18 +118,6 @@
|
|||
<textarea id="c-introductioncontent" class="form-control editor" rows="5" name="row[introductioncontent]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-hotel_id" class="control-label col-xs-12 col-sm-2">{:__('Hotel_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hotel_id" data-rule="required" data-source="hotel/index" class="form-control selectpage" name="row[hotel_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-trip_id" class="control-label col-xs-12 col-sm-2">{:__('Trip_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-trip_id" data-rule="required" data-source="trip/index" class="form-control selectpage" name="row[trip_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-descriptioncontent" class="control-label col-xs-12 col-sm-2">{:__('Descriptioncontent')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
|
|
|||
|
|
@ -118,18 +118,6 @@
|
|||
<textarea id="c-introductioncontent" class="form-control editor" rows="5" name="row[introductioncontent]" cols="50">{$row.introductioncontent}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-hotel_id" class="control-label col-xs-12 col-sm-2">{:__('Hotel_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hotel_id" data-rule="required" data-source="hotel/index" class="form-control selectpage" name="row[hotel_id]" type="text" value="{$row.hotel_id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-trip_id" class="control-label col-xs-12 col-sm-2">{:__('Trip_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-trip_id" data-rule="required" data-source="trip/index" class="form-control selectpage" name="row[trip_id]" type="text" value="{$row.trip_id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-descriptioncontent" class="control-label col-xs-12 col-sm-2">{:__('Descriptioncontent')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="c-num" class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-num" class="form-control" name="row[num]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-city" class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-lead_language" class="control-label col-xs-12 col-sm-2">{:__('Lead_language')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-lead_language" data-rule="required" class="form-control " rows="5" name="row[lead_language]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" class="form-control" size="50" name="row[image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline plupload-preview" id="p-image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-status" class="form-control" name="row[status]" type="number" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-create_time" class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-update_time" class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-read_num" class="control-label col-xs-12 col-sm-2">{:__('Read_num')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-read_num" class="form-control" name="row[read_num]" type="number">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="1">
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="form-group 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,84 @@
|
|||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="c-num" class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-num" class="form-control" name="row[num]" type="text" value="{$row.num}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-city" class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value="{$row.city}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-lead_language" class="control-label col-xs-12 col-sm-2">{:__('Lead_language')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-lead_language" data-rule="required" class="form-control " rows="5" name="row[lead_language]" cols="50">{$row.lead_language}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline plupload-preview" id="p-image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-status" class="form-control" name="row[status]" type="number" value="{$row.status}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-create_time" class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{$row.create_time|datetime}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-update_time" class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{$row.update_time|datetime}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="c-read_num" class="control-label col-xs-12 col-sm-2">{:__('Read_num')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-read_num" class="form-control" name="row[read_num]" type="number" value="{$row.read_num}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id}">
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="form-group 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,33 @@
|
|||
<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">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('raiders/raiders/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('raiders/raiders/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('raiders/raiders/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('raiders/raiders/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('raiders/raiders/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('raiders/raiders/edit')}"
|
||||
data-operate-del="{:$auth->check('raiders/raiders/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,15 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Windows 10
|
||||
* User: kaiend
|
||||
* Date: 2018-02-01
|
||||
* Time: 11:34
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
use app\common\controller\Api;
|
||||
|
||||
|
||||
class Cat
|
||||
class Cart extends Api
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,114 @@
|
|||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
use app\common\controller\Api;
|
||||
|
||||
|
||||
class Order
|
||||
/**
|
||||
* 订单api接口
|
||||
* Class Order
|
||||
* @package app\api\controller
|
||||
*/
|
||||
class Order extends Api
|
||||
{
|
||||
/**
|
||||
* 插入订单
|
||||
* @return mixed
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isPost())
|
||||
{
|
||||
//$params = $this->request->post("row/a");
|
||||
$params = input('post');
|
||||
if ($params)
|
||||
{
|
||||
if ($this->dataLimit && $this->dataLimitFieldAutoFill)
|
||||
{
|
||||
$params[$this->dataLimitField] = $this->auth->id;
|
||||
}
|
||||
try
|
||||
{
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate)
|
||||
{
|
||||
$name = basename(str_replace('\\', '/', get_class($this->model)));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate;
|
||||
$this->model->validate($validate);
|
||||
}
|
||||
$result = $this->model->allowField(true)->save($params);
|
||||
if ($result !== false)
|
||||
{
|
||||
$this->success('','',json(),[]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error($this->getError());
|
||||
}
|
||||
}
|
||||
catch (\think\exception\PDOException $e)
|
||||
{
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
//return $this->view->fetch();
|
||||
return json('',200,[],'');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取订单
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 倒计时删除订单
|
||||
*/
|
||||
public function del($ids = "")
|
||||
{
|
||||
if ($ids)
|
||||
{
|
||||
$pk = $this->model->getPk();
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds))
|
||||
{
|
||||
$count = $this->model->where($this->dataLimitField, 'in', $adminIds);
|
||||
}
|
||||
$list = $this->model->where($pk, 'in', $ids)->select();
|
||||
$count = 0;
|
||||
foreach ($list as $k => $v)
|
||||
{
|
||||
$count += $v->delete();
|
||||
}
|
||||
if ($count)
|
||||
{
|
||||
$this->success('操作成功','',json(),[]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error(__('No rows were deleted'));
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示订单
|
||||
*/
|
||||
public function order_list()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: kaiend
|
||||
* Date: 2018-02-02
|
||||
* Time: 13:40
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\controller\Api;
|
||||
|
||||
class Product extends Api
|
||||
{
|
||||
/**
|
||||
* 读取产品信息
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags']);
|
||||
if ($this->request->isAjax())
|
||||
{
|
||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||
if ($this->request->request('pkey_name'))
|
||||
{
|
||||
return $this->selectpage();
|
||||
}
|
||||
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();
|
||||
|
||||
$result = array("total" => $total, "rows" => $list);
|
||||
|
||||
return json($result);
|
||||
}
|
||||
//return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Windows 10
|
||||
* User: kaiend
|
||||
* Date: 2018-02-01
|
||||
* Time: 13:26
|
||||
*/
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
|
||||
class Cart
|
||||
use think\Model;
|
||||
class Cart extends Model
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: kaiend
|
||||
* Date: 2018-02-02
|
||||
* Time: 13:42
|
||||
*/
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
public function read()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ return [
|
|||
// 数据库类型
|
||||
'type' => Env::get('database.type', 'mysql'),
|
||||
// 服务器地址
|
||||
'hostname' => Env::get('database.hostname', 'localhost'),
|
||||
'hostname' => Env::get('database.hostname', '39.106.45.64'),
|
||||
// 数据库名
|
||||
'database' => Env::get('database.database', 'qulvxing'),
|
||||
// 用户名
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// | Author: liu21st <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
/*return [
|
||||
//别名配置,别名只能是映射到控制器且访问时必须加上请求的方法
|
||||
'__alias__' => [
|
||||
],
|
||||
|
|
@ -22,4 +22,7 @@ return [
|
|||
// 'admin' => 'admin',
|
||||
// 'api' => 'api',
|
||||
// ],
|
||||
];
|
||||
];*/
|
||||
use \think\Route;
|
||||
Route::resource('order','api/order');
|
||||
Route::resource('order/:id','api/order/read');
|
||||
|
|
@ -41,8 +41,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'supplier_price', title: __('Supplier_price')},
|
||||
{field: 'supplier_start', title: __('Supplier_start'), operate:'RANGE', addclass:'datetimerange'},
|
||||
{field: 'supplier_end', title: __('Supplier_end'), operate:'RANGE', addclass:'datetimerange'},
|
||||
{field: 'hotel_id', title: __('Hotel_id')},
|
||||
{field: 'trip_id', title: __('Trip_id')},
|
||||
{field: 'in_stock', title: __('In_stock')},
|
||||
{field: 'list', title: __('List'), visible:false, searchList: {"list 0":__('List 0'),"list 1":__('List 1'),"list 2":__('List 2'),"list 3":__('List 3'),"list 4":__('List 4')}},
|
||||
{field: 'list_text', title: __('List'), operate:false},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'raiders/raiders/index',
|
||||
add_url: 'raiders/raiders/add',
|
||||
edit_url: 'raiders/raiders/edit',
|
||||
del_url: 'raiders/raiders/del',
|
||||
multi_url: 'raiders/raiders/multi',
|
||||
table: 'raiders',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'num', title: __('Num')},
|
||||
{field: 'title', title: __('Title')},
|
||||
{field: 'city', title: __('City')},
|
||||
{field: 'lead_language', title: __('Lead_language')},
|
||||
{field: 'image', title: __('Image'), formatter: Table.api.formatter.image},
|
||||
{field: 'status', title: __('Status')},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
|
||||
{field: 'read_num', title: __('Read_num')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{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 () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -7902,7 +7902,7 @@
|
|||
.attr('src', url)
|
||||
.attr('width', '640').attr('height', '360');
|
||||
} else {
|
||||
// this is not a known video link. Now what, Cat? Now what?
|
||||
// this is not a known video link. Now what, Cart? Now what?
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue