作者 郭盛

第一次提交

正在显示 51 个修改的文件 包含 4749 行增加0 行删除

要显示太多修改。

为保证性能只显示 51 of 51+ 个文件。

... ... @@ -175,4 +175,50 @@ class PublicController extends RestBaseController
}
/**
* @title 通过code获取token
* @description 通过code获取token
* @author Tiger Yang
* @url /wxapp/public/getToken
* @method POST
*
* @param name:code type:string require:1 other: desc:code
*
* @return is_register:是否注册(0未注册,1已注册)
* @return token:token
*/
public function getToken(){
$validate = new Validate([
'code' => 'require',
]);
$validate->message([
'code.require' => '缺少参数code!',
]);
$data = $this->request->param();
if (!$validate->check($data)) {
$this->error(['code'=>'40003','msg'=>$validate->getError()]);
}
$code = $data['code'];
$appId = config('app_id');
$appSecret = config('app_secret');
$response = cmf_curl_get("https://api.weixin.qq.com/sns/jscode2session?appid=$appId&secret=$appSecret&js_code=$code&grant_type=authorization_code");
$response = json_decode($response, true);
if (!empty($response['errcode'])) {
$this->error(['code'=>'41001','msg'=>'操作失败:'.$response['errcode']]);
}
$third_party_user = Db::name('third_party_user')->where(['openid'=>$response['openid']])->find();
if(empty($third_party_user)){
$this->success('SUCCESS',['is_register'=>0]);
}
$user_token = Db::name('user_token')->where(['user_id'=>$third_party_user['user_id'],'device_type'=>'wxapp'])->find();
$data['is_register'] = 1;
$data['token'] = $user_token['token'];
$this->success('SUCCESS',$data);
}
}
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/11
* Time: 15:27
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class AboutController extends AdminBaseController
{
public function index()
{
$id = $this->request->param('id', 1, 'intval');
if ($this->request->isPost()) {
$param = $this->request->param();
$validate = new Validate([
'content' => 'require',
]);
$validate->message([
'content' => '介绍不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
Db::name('about')
->where('id', $id)
->update($param);
$this->success('更新成功');
} else {
$data = Db::name('about')
->where('id', $id)
->find();
$this->assign([
'data' => $data,
]);
return $this->fetch();
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/31
* Time: 15:36
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class AttrController extends AdminBaseController
{
public function index()
{
$where = [];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['a.attr_name'] = ['like', "%$keyword%"];
}
$data = Db::name('attr')
->alias('a')
->join('rgoods r','a.rgoods_id = r.id')
->field('a.*,r.rgoods_name')
->where($where)
->order('a.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'attr_name'=>'require',
'attr_price'=>'require'
]);
$validate->message([
'attr_name'=>'属性名称不能为空',
'attr_price'=>'属性对应价格不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('attr')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'attr_name'=>'require',
'attr_price'=>'require'
]);
$validate->message([
'attr_name'=>'属性名称不能为空',
'attr_price'=>'属性对应价格不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('attr')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('attr')
->where('id',$id)
->find();
$data['rgoods'] = Db::name('rgoods')->whereIn('id',$data['rgoods_id'])->field('id,rgoods_name')->select();
$keyword = $this->request->param('keyword');
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign('data',$data);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('attr')
->where(['id' => $id])
->delete();
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('attr')
->where(['id' => ['in', $ids]])
->delete();
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 11:53
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class FeeController extends AdminBaseController
{
public function index()
{
$id = $this->request->param('id', 1, 'intval');
if ($this->request->isPost()) {
$param = $this->request->param();
$validate = new Validate([
'fee'=>'require',
]);
$validate->message([
'images'=>'服务费不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('recyclefee')
->where('id', $id)
->update($param);
$this->success('更新成功');
} else {
$data = Db::name('recyclefee')
->where('id', $id)
->find();
$this->assign([
'data' => $data,
]);
return $this->fetch();
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/6
* Time: 9:47
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class HomeController extends AdminBaseController
{
public function index()
{
$where['delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['home_name'] = ['like', "%$keyword%"];
}
$data = Db::name('home')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'home_name'=>'require',
'home_address'=>'require',
'home_phone'=>'require|max:11',
'thumbnail'=>'require',
'content'=>'require'
]);
$validate->message([
'home_name'=>'家政公司名称不能为空',
'home_address'=>'家政公司地址不能为空',
'home_phone.require'=>'家政公司联系电话不能为空',
'home_phone.max'=>'联系电话最多为11位',
'thumbnail'=>'缩略图不能为空',
'content'=>'详情不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('home')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//修改
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'home_name'=>'require',
'home_address'=>'require',
'home_phone'=>'require|max:11',
'thumbnail'=>'require',
'content'=>'require'
]);
$validate->message([
'home_name'=>'家政公司名称不能为空',
'home_address'=>'家政公司地址不能为空',
'home_phone.require'=>'家政公司联系电话不能为空',
'home_phone.max'=>'联系电话最多为11位',
'thumbnail'=>'缩略图不能为空',
'content'=>'详情不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('home')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('home')
->where('id',$id)
->find();
$keyword = $this->request->param('keyword');
$this->assign('data',$data);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('home')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
//家政公司类表
public function select()
{
$where['delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['home_name'] = ['like', "%$keyword%"];
}
$data = Db::name('home')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign('page',$data->render());
$this->assign('data',$list);
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('ids',empty($param['ids']) ? '' : $param['ids']);
return $this->fetch();
}
//查看服务类目
public function service()
{
$id=$this->request->param('id', 0, 'intval');
$keyword=$this->request->param('keyword');
$data = Db::name('service')
->alias('a')
->join('home r','a.home_id=r.id')
->field('a.*,r.home_name')
->where('a.delete_time',0)
->where('r.id',$id)
->order('a.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/30
* Time: 11:57
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class HomePicController extends AdminBaseController
{
public function index()
{
$data = Db::name('homepic')
->where('delete_time',0)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'url'=>'require|url',
'thumbnail'=>'require',
]);
$validate->message([
'url.require'=>'链接地址不能为空',
'url.url'=>'链接地址格式不正确',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('homepic')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'url'=>'require|url',
'thumbnail'=>'require',
]);
$validate->message([
'url.require'=>'链接地址不能为空',
'url.url'=>'链接地址格式不正确',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('homepic')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('homepic')
->where('id',$id)
->find();
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('homepic')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('homepic')
->where(['id' => ['in', $ids]])
->update(['delete_time' => time()]);
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/30
* Time: 16:47
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class NoRecycleController extends AdminBaseController
{
public function index()
{
$where['delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['recycle_name'] = ['like', "%$keyword%"];
}
$data = Db::name('norecycletype')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'recycle_name'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'recycle_name'=>'类型名称不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('norecycletype')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'recycle_name'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'recycle_name'=>'类型名称不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('norecycletype')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('norecycletype')
->where('id',$id)
->find();
$keyword = $this->request->param('keyword');
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$data = Db::name('norecyclegoods')->where('recycletype_id',$id)->field('id')->select()->toArray();
if(!empty($data)){
$this->error('该类型下有物品,暂时不能删除');
}else{
$resultPortal = Db::name('norecycletype')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
//添加不可回收物
public function addgoods(){
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'name'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'name'=>'回收物品名称不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('norecyclegoods')
->insert($param);
// $this->redirect("Recycle/showgoods",array("id"=>$param['recycletype_id']));
$this->success('添加成功','index');
}else{
$id = $this->request->param('id');
$keyword = $this->request->param('keyword');
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign('data',$id);
return $this->fetch();
}
}
//查看不可回收物
public function showgoods(){
$id=$this->request->param('id', 0, 'intval');
$keyword = $this->request->param('keyword');
$data = Db::name('norecyclegoods')
->alias('g')
->join('norecycletype t','g.recycletype_id = t.id')
->field('g.*,t.recycle_name')
->where('g.recycletype_id',$id)
->order('g.id desc')
->paginate(10);
$list=$data->items();
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//编辑不可回收物
public function editgoods(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'name'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'name'=>'回收物名称不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$data = Db::name('norecyclegoods')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('norecyclegoods')
->where('id',$id)
->find();
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除不可回收物
public function deletegoods(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('norecyclegoods')
->where(['id' => $id])
->delete();
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('norecyclegoods')
->where(['id' => ['in', $ids]])
->delete();
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/30
* Time: 9:01
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class PicController extends AdminBaseController
{
public function index()
{
$data = Db::name('pic')
->where('delete_time',0)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'url'=>'require|url',
'thumbnail'=>'require',
]);
$validate->message([
'url.require'=>'链接地址不能为空',
'url.url'=>'链接地址格式不正确',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('pic')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'url'=>'require|url',
'thumbnail'=>'require',
]);
$validate->message([
'url.require'=>'链接地址不能为空',
'url.url'=>'链接地址格式不正确',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('pic')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('pic')
->where('id',$id)
->find();
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('pic')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('pic')
->where(['id' => ['in', $ids]])
->update(['delete_time' => time()]);
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/11
* Time: 13:17
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class PointController extends AdminBaseController
{
public function index()
{
$where['delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['point_name'] = ['like', "%$keyword%"];
}
$data = Db::name('point')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'point_name'=>'require',
'thumbnail'=>'require',
'address'=>'require',
]);
$validate->message([
'point_name'=>'回收站名称不能为空',
'thumbnail'=>'缩略图不能为空',
'address'=>'详细地址不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
//获取经纬度
$url='http://api.map.baidu.com/geocoder/v2/?address='.$param['address'].'&output=json&ak=cIGo3zYrN4WOEnMDSbxynUi9M20i9IgY';
$result=file_get_contents($url);
$res=json_decode($result,true);
//经度
$param['lng']= $res['result']['location']['lng'];
//纬度
$param['lat']= $res['result']['location']['lat'];
Db::name('point')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//修改
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$param['update_time'] = time();
$validate = new Validate([
'point_name'=>'require',
'thumbnail'=>'require',
'address'=>'require',
]);
$validate->message([
'point_name'=>'回收站名称不能为空',
'thumbnail'=>'缩略图不能为空',
'address'=>'详细地址不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
//获取经纬度
$url='http://api.map.baidu.com/geocoder/v2/?address='.$param['address'].'&output=json&ak=cIGo3zYrN4WOEnMDSbxynUi9M20i9IgY';
$result=file_get_contents($url);
$res=json_decode($result,true);
//经度
$param['lng']= $res['result']['location']['lng'];
//纬度
$param['lat']= $res['result']['location']['lat'];
$data = Db::name('point')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','index');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('point')
->where('id',$id)
->find();
$keyword = $this->request->param('keyword');
$this->assign('data',$data);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('point')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/11
* Time: 15:54
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class ProjectController extends AdminBaseController
{
//产品方案
public function index()
{
$id = $this->request->param('id', 1, 'intval');
if ($this->request->isPost()) {
$param = $this->request->param();
$validate = new Validate([
'content' => 'require',
]);
$validate->message([
'content' => '内容不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
Db::name('project')
->where('id', $id)
->update($param);
$this->success('更新成功');
} else {
$data = Db::name('project')
->where('id', $id)
->find();
$this->assign([
'data' => $data,
]);
return $this->fetch();
}
}
//加入我们
public function select()
{
$id = $this->request->param('id', 1, 'intval');
if ($this->request->isPost()) {
$param = $this->request->param();
$validate = new Validate([
'content' => 'require',
]);
$validate->message([
'content' => '内容不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
Db::name('joinus')
->where('id', $id)
->update($param);
$this->success('更新成功');
} else {
$data = Db::name('joinus')
->where('id', $id)
->find();
$this->assign([
'data' => $data,
]);
return $this->fetch();
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/30
* Time: 14:12
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class RecycleController extends AdminBaseController
{
public function index()
{
$where['delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['recycle_name'] = ['like', "%$keyword%"];
}
$data = Db::name('recycletype')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'recycle_name'=>'require',
'price'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'recycle_name'=>'类型名称不能为空',
'price'=>'价格不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('recycletype')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'recycle_name'=>'require',
'price'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'recycle_name'=>'类型名称不能为空',
'price'=>'价格不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('recycletype')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('recycletype')
->where('id',$id)
->find();
$keyword = $this->request->param('keyword');
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$data = Db::name('recyclegoods')->where('recycletype_id',$id)->field('id')->select()->toArray();
if(!empty($data)){
$this->error('该类型下有物品,暂时不能删除');
}else{
$resultPortal = Db::name('recycletype')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
//添加回收物
public function addgoods(){
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'name'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'name'=>'回收物品名称不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('recyclegoods')
->insert($param);
// $this->redirect("Recycle/showgoods",array("id"=>$param['recycletype_id']));
$this->success('添加成功','index');
}else{
$id = $this->request->param('id');
$keyword = $this->request->param('keyword');
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign('data',$id);
return $this->fetch();
}
}
//查看回收物
public function showgoods(){
$id=$this->request->param('id', 0, 'intval');
$keyword = $this->request->param('keyword');
$data = Db::name('recyclegoods')
->alias('g')
->join('recycletype t','g.recycletype_id = t.id')
->field('g.*,t.recycle_name')
->where('g.recycletype_id',$id)
->order('g.id desc')
->paginate(10);
$list=$data->items();
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//编辑回收物
public function editgoods(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'name'=>'require',
'thumbnail'=>'require',
]);
$validate->message([
'name'=>'回收物名称不能为空',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$data = Db::name('recyclegoods')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('recyclegoods')
->where('id',$id)
->find();
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除回收物
public function deletegoods(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('recyclegoods')
->where(['id' => $id])
->delete();
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('recyclegoods')
->where(['id' => ['in', $ids]])
->delete();
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/31
* Time: 11:41
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class RgoodsController extends AdminBaseController
{
public function index()
{
$where['r.delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['r.rgoods_name'] = ['like', "%$keyword%"];
}
$data = Db::name('rgoods')
->alias('r')
->join('rtype t','r.rtype_id = t.id')
->field('r.*,t.recycle_type_name')
->where($where)
->order('r.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'rgoods_name'=>'require',
'rtype_id'=>'require',
]);
$validate->message([
'rgoods_name'=>'商品名称不能为空',
'rtype_id'=>'所属分类不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('rgoods')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//修改
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'rgoods_name'=>'require',
'rtype_id'=>'require',
]);
$validate->message([
'rgoods_name'=>'商品名称不能为空',
'rtype_id'=>'所属分类不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('rgoods')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','index');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('rgoods')
->where('id',$id)
->find();
$data['rtype'] = Db::name('rtype')->field('id,recycle_type_name')->whereIn('id',$data['rtype_id'])->select();
$keyword = $this->request->param('keyword');
$this->assign('data',$data);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('rgoods')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
public function select()
{
$where = [];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['r.rgoods_name'] = ['like', "%$keyword%"];
}
$data = Db::name('rgoods')
->alias('r')
->join('rtype t','r.rtype_id = t.id')
->field('r.*,t.recycle_type_name')
->where($where)
->order('r.id desc')
->paginate(10);
$list=$data->items();
$this->assign('page',$data->render());
$this->assign('data',$list);
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('ids',empty($param['ids']) ? '' : $param['ids']);
return $this->fetch();
}
//查看属性
public function selectAttr()
{
$id=$this->request->param('id', 0, 'intval');
$keyword=$this->request->param('keyword');
$data = Db::name('attr')
->alias('a')
->join('rgoods r','a.rgoods_id=r.id')
->field('a.*,r.rgoods_name')
->where('a.rgoods_id',$id)
->order('a.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/31
* Time: 14:19
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class RtypeController extends AdminBaseController
{
public function index()
{
$where = [];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['recycle_type_name'] = ['like', "%$keyword%"];
}
$data = Db::name('rtype')
->where('delete_time',0)
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'recycle_type_name'=>'require',
]);
$validate->message([
'recycle_type_name'=>'类型名称不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('rtype')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'recycle_type_name'=>'require',
]);
$validate->message([
'recycle_type_name'=>'类型名称不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('rtype')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('rtype')
->where('id',$id)
->find();
$keyword = $this->request->param('keyword');
$this->assign([
'data'=>$data,
]);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$data = Db::name('rgoods')
->where('rtype_id',$id)
->field('id')
->select()
->toArray();
if(!empty($data)){
$this->error("该分类下有商品,暂时无法删除", '');
}else{
$resultPortal = Db::name('rtype')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
//
// if (isset($param['ids'])) {
// $ids = $this->request->param('ids/a');
// $result = Db::name('rtype')
// ->where(['id' => ['in', $ids]])
// ->update(['delete_time' => time()]);
// if ($result) {
// $this->success("删除成功", '');
// }else{
// $this->error("删除失败", '');
// }
// }
}
//分类列表
public function select()
{
$where = [];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['recycle_type_name'] = ['like', "%$keyword%"];
}
$data = Db::name('rtype')
->where('delete_time',0)
->where($where)
->order('id desc')
->paginate(10);
$data->appends($param);
$list=$data->items();
$this->assign('page',$data->render());
$this->assign('data',$list);
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('ids',empty($param['ids']) ? '' : $param['ids']);
return $this->fetch();
}
//查看该分类下的商品
public function goods()
{
$param = $this->request->param();
$data = Db::name('rgoods')
->alias('a')
->join('rtype b','a.rtype_id = b.id')
->field('a.*,b.recycle_type_name')
->where('a.rtype_id',$param['id'])
->where('a.delete_time',0)
->order('a.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'data'=>$list,
'page'=>$data->render()
]);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/6
* Time: 16:37
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class SeverController extends AdminBaseController
{
public function index()
{
$where['a.delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['a.sever_name'] = ['like', "%$keyword%"];
}
$data = Db::name('service')
->alias('a')
->join('home h','a.home_id = h.id')
->field('a.*,h.home_name')
->where($where)
->order('a.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'sever_name'=>'require',
'home_id'=>'require',
'price'=>'require',
]);
$validate->message([
'sever_name'=>'服务类目名称不能为空',
'home_id'=>'所属公司不能为空',
'price'=>'所需积分不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('service')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//修改
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'sever_name'=>'require',
'home_id'=>'require',
'price'=>'require',
]);
$validate->message([
'sever_name'=>'服务类目名称不能为空',
'home_id'=>'所属公司不能为空',
'price'=>'所需积分不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('service')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('service')
->where('id',$id)
->find();
$data['home'] = Db::name('home')->whereIn('id',$data['home_id'])->field('id,home_name')->select();
$keyword = $this->request->param('keyword');
$this->assign('data',$data);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('service')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/10/30
* Time: 11:28
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class ShopPicController extends AdminBaseController
{
public function index()
{
$data = Db::name('shoppic')
->where('delete_time',0)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'url'=>'require|url',
'thumbnail'=>'require',
]);
$validate->message([
'url.require'=>'链接地址不能为空',
'url.url'=>'链接地址格式不正确',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('shoppic')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'url'=>'require|url',
'thumbnail'=>'require',
]);
$validate->message([
'url.require'=>'链接地址不能为空',
'url.url'=>'链接地址格式不正确',
'thumbnail'=>'请上传缩略图',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('shoppic')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('shoppic')
->where('id',$id)
->find();
$this->assign([
'data'=>$data,
]);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('shoppic')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('shoppic')
->where(['id' => ['in', $ids]])
->update(['delete_time' => time()]);
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/4
* Time: 16:04
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class ShopgoodsController extends AdminBaseController
{
public function index()
{
$where['r.delete_time'] = ['eq',0];
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['r.goods_name'] = ['like', "%$keyword%"];
}
$data = Db::name('shopgoods')
->alias('r')
->join('shoptype s','r.shoptype_id = s.id')
->field('r.*,s.type_name')
->where($where)
->order('r.id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'goods_name'=>'require',
'shoptype_id'=>'require',
'price'=>'require',
'freight'=>'require',
'thumbnail'=>'require',
'images'=>'require',
'content'=>'require'
]);
$validate->message([
'rgoods_name'=>'商品名称不能为空',
'shoptype_id'=>'所属分类不能为空',
'price'=>'兑换积分不能为空',
'freight'=>'运费不能为空',
'thumbnail'=>'缩略图不能为空',
'images'=>'轮播图不能为空',
'content'=>'商品详情不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['images'] = implode(',',$param['images']);
Db::name('shopgoods')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//修改
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'goods_name'=>'require',
'shoptype_id'=>'require',
'price'=>'require',
'freight'=>'require',
'thumbnail'=>'require',
'images'=>'require',
'content'=>'require'
]);
$validate->message([
'rgoods_name'=>'商品名称不能为空',
'shoptype_id'=>'所属分类不能为空',
'price'=>'兑换所需积分为空',
'freight'=>'运费不能为空',
'thumbnail'=>'缩略图不能为空',
'images'=>'轮播图不能为空',
'content'=>'商品详情不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$param['images'] = implode(',',$param['images']);
$data = Db::name('shopgoods')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!','index');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('shopgoods')
->where('id',$id)
->find();
$data['shoptype'] = Db::name('shoptype')->field('id,type_name')->whereIn('id',$data['shoptype_id'])->select();
$keyword = $this->request->param('keyword');
$this->assign('data',$data);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('shopgoods')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/5
* Time: 11:20
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class ShoporderController extends AdminBaseController
{
public function index()
{
$where['a.delete_time'] = ['eq',0];
$param = $this->request->param();
$startTime = empty($param['start_time']) ? '' : strtotime($param['start_time']);
$endTime = empty($param['end_time']) ? '' : (strtotime($param['end_time']));
if (!empty($startTime) && !empty($endTime)) {
$where['r.create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
} else {
if (!empty($startTime)) {
$where['r.create_time'] = ['>= time', $startTime];
}
if (!empty($endTime)) {
$where['r.create_time'] = ['<= time', $endTime];
}
}
$data = Db::name('shoporder')
->alias('a')
->join('shopgoods r','a.shopgoods_id = r.id')
->field('a.*,r.goods_name,r.price')
->where($where)
->order('a.id desc')
->paginate(10);
$list=$data->items();
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'attr_name'=>'require',
'attr_price'=>'require'
]);
$validate->message([
'attr_name'=>'属性名称不能为空',
'attr_price'=>'属性对应价格不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('attr')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'attr_name'=>'require',
'attr_price'=>'require'
]);
$validate->message([
'attr_name'=>'属性名称不能为空',
'attr_price'=>'属性对应价格不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('attr')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('attr')
->where('id',$id)
->find();
$data['rgoods'] = Db::name('rgoods')->whereIn('id',$data['rgoods_id'])->field('id,rgoods_name')->select();
$keyword = $this->request->param('keyword');
$this->assign('keyword', isset($keyword) ? $keyword : '');
$this->assign('data',$data);
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$resultPortal = Db::name('attr')
->where(['id' => $id])
->delete();
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
if (isset($param['ids'])) {
$ids = $this->request->param('ids/a');
$result = Db::name('attr')
->where(['id' => ['in', $ids]])
->delete();
if ($result) {
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/4
* Time: 13:26
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class ShoptypeController extends AdminBaseController
{
public function index()
{
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['type_name'] = ['like', "%$keyword%"];
}
$where['delete_time'] = ['eq',0];
$data = Db::name('shoptype')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign([
'keyword'=>$keyword,
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
//添加
public function add()
{
if($this->request->isPost()){
$param=$this->request->param();
$param['create_time']=time();
$validate = new Validate([
'type_name'=>'require',
]);
$validate->message([
'type_name'=>'类型名称不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
Db::name('shoptype')
->insert($param);
$this->success('添加成功!','index');
}else{
return $this->fetch();
}
}
//编辑
public function edit(){
$id=$this->request->param('id', 0, 'intval');
if($this->request->isPost()){
$param=$this->request->param();
$validate = new Validate([
'type_name'=>'require',
]);
$validate->message([
'type_name'=>'类型名称不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
$data = Db::name('shoptype')
->where('id',$id)
->update($param);
if($data){
$this->success('更新成功!');
}else{
$this->error('sql执行错误');
}
}else{
$data=Db::name('shoptype')
->where('id',$id)
->find();
$keyword = $this->request->param('keyword');
$this->assign([
'data'=>$data,
]);
$this->assign('keyword', isset($keyword) ? $keyword : '');
return $this->fetch();
}
}
//删除
public function delete(){
$param = $this->request->param();
if (isset($param['id'])) {
$id = $this->request->param('id', 0, 'intval');
$data = Db::name('shopgoods')
->where('shoptype_id',$id)
->where('delete_time',0)
->field('id')
->select()
->toArray();
if(!empty($data)){
$this->error("该分类下有商品,暂时无法删除", '');
}else{
$resultPortal = Db::name('shoptype')
->where(['id' => $id])
->update(['delete_time' => time()]);
if($resultPortal){
$this->success("删除成功", '');
}else{
$this->error("删除失败", '');
}
}
}
//
// if (isset($param['ids'])) {
// $ids = $this->request->param('ids/a');
// $result = Db::name('rtype')
// ->where(['id' => ['in', $ids]])
// ->update(['delete_time' => time()]);
// if ($result) {
// $this->success("删除成功", '');
// }else{
// $this->error("删除失败", '');
// }
// }
}
public function select(){
$param = $this->request->param();
$keyword = empty($param['keyword']) ? '' : $param['keyword'];
if (!empty($keyword)) {
$where['type_name'] = ['like', "%$keyword%"];
}
$where['delete_time'] = ['eq',0];
$data = Db::name('shoptype')
->where($where)
->order('id desc')
->paginate(10);
$list=$data->items();
$this->assign('page',$data->render());
$this->assign('data',$list);
$this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
$this->assign('ids',empty($param['ids']) ? '' : $param['ids']);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/4
* Time: 9:09
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class SubscribeController extends AdminBaseController
{
public function index()
{
$where['r.delete_time'] = ['eq',0];
$param = $this->request->param();
$startTime = empty($param['start_time']) ? '' : strtotime($param['start_time']);
$endTime = empty($param['end_time']) ? '' : (strtotime($param['end_time']));
if (!empty($startTime) && !empty($endTime)) {
$where['r.create_time'] = [['>= time', $startTime], ['<= time', $endTime]];
} else {
if (!empty($startTime)) {
$where['r.create_time'] = ['>= time', $startTime];
}
if (!empty($endTime)) {
$where['r.create_time'] = ['<= time', $endTime];
}
}
$data = Db::name('subscribe')
->alias('r')
->join('recycle t','r.recycle_id = t.id')
->field('r.*,t.*')
->where($where)
->order('r.id desc')
->paginate(10);
$list=$data->items();
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
$this->assign([
'data'=>$list,
'page'=>$data->render(),
]);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 17:07
*/
namespace app\index\controller;
use cmf\controller\HomeBaseController;
use cmf\controller\RestBaseController;
use think\Db;
use think\Validate;
class DoorController extends HomeBaseController
{
public function index()
{
// $id = $this->getUserID();
$id = cmf_get_current_user_id();
$where['delete_time'] = ['eq',0];
$data = Db::name('recycle')
->where($where)
->select()
->toArray();
$this->assign('data',$data);
return $this->fetch();
}
public function add()
{
$param = $this->request->param();
$param['create_time']=time();
$validate = new Validate([
'name'=>'require',
'phone'=>'require|max:11',
'address'=>'require'
]);
$validate->message([
'name'=>'姓名不能为空',
'phone.require'=>'联系方式不能为空',
'phone.max'=>'联系方式最多11位',
'address'=>'详细地址不能为空'
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 14:19
*/
namespace app\index\controller;
use app\index\model\NorecyclegoodsModel;
use app\index\model\NorecycletypeModel;
use app\index\model\RecyclegoodsModel;
use app\index\model\RecycletypeModel;
use cmf\controller\HomeBaseController;
class RecycleController extends HomeBaseController
{
//可回收物
public function index(){
$where['delete_time'] = ['eq',0];
$recycleModel = new RecycletypeModel();
$data = $recycleModel->selectData($where)->toArray();
$recycleGoodsModel = new RecyclegoodsModel();
$tiao = [];
$res = $recycleGoodsModel->selectData($tiao)->toArray();
foreach ($data as &$v){
$v['recyclegoods'] = [];
foreach ($res as $key=>$val){
if($val['recycletype_id'] == $v['id']){
array_push($v['recyclegoods'],$val);
}
}
}
$this->assign('data',$data);
return $this->fetch();
}
//不可回收物
public function noRecycle()
{
$where['delete_time'] = ['eq',0];
$recycleModel = new NorecycletypeModel();
$data = $recycleModel->selectData($where)->toArray();
$recycleGoodsModel = new NorecyclegoodsModel();
$tiao = [];
$res = $recycleGoodsModel->selectData($tiao)->toArray();
foreach ($data as &$v){
$v['norecyclegoods'] = [];
foreach ($res as $key=>$val){
if($val['recycletype_id'] == $v['id']){
array_push($v['norecyclegoods'],$val);
}
}
}
$this->assign('data',$data);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/9
* Time: 14:19
*/
namespace app\index\controller;
use app\index\model\ShopgoodsModel;
use app\index\model\ShoppicModel;
use app\index\model\ShoptypeModel;
use cmf\controller\HomeBaseController;
use think\Db;
class ShopgoodsController extends HomeBaseController
{
//商品分类列表
public function index()
{
$where['delete_time'] = ['eq',0];
$shopTypeModel = new ShoptypeModel();
$data = $shopTypeModel->selectData($where)->toArray();
$this->assign('data',$data);
return $this->fetch();
}
//商品类表
public function goods(){
$shoptype_id = $this->request->param('shoptype_id');
if(empty($shoptype_id)){
$shopGoodsModel = new ShopgoodsModel();
$where['delete_time'] = ['eq',0];
$data = $shopGoodsModel->selectData($where)->toArray();
$this->assign('data',$data);
return $this->fetch();
}else{
$shopGoodsModel = new ShopgoodsModel();
$where['delete_time'] = ['eq',0];
$where['shoptype_id'] = ['eq',$shoptype_id];
$data = $shopGoodsModel->selectData($where)->toArray();
$this->assign('data',$data);
return $this->fetch();
}
}
//商城轮播图
public function photo(){
$where['delete_time'] = ['eq',0];
$shopPicModel = new ShoppicModel();
$data = $shopPicModel->selectData($where)->toArray();
$this->assign('data',$data);
return $this->fetch();
}
//商城搜索页
public function search(){
$keyword = $this->request->param('keyword');
if(empty($keyword)){
$this->error('请输入要搜索的内容');
}
$where['goods_name'] = ['like',"%$keyword%"];
$shopGoodsModel = new ShopgoodsModel();
$data = $shopGoodsModel->selectData($where)->toArray();
$this->assign('data',$data);
return $this->fetch();
}
//商品详情页
public function goodsDetail(){
$goods_id = $this->request->param('id',0,'intval');
if(empty($goods_id)){
$this->error('404');
}
$where['id'] = ['eq',$goods_id];
$shopGoodsModel = new ShopgoodsModel();
$data = $shopGoodsModel->findData($where)->toArray();
$this->assign('data',$data);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 14:51
*/
namespace app\index\model;
use think\Model;
class NorecyclegoodsModel extends Model
{
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function selectData($where){
$data = $this
->where($where)
->select();
return $data;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 14:54
*/
namespace app\index\model;
use think\Model;
class NorecycletypeModel extends Model
{
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function selectData($where){
$data = $this
->where($where)
->select();
return $data;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 14:30
*/
namespace app\index\model;
use think\Model;
class RecyclegoodsModel extends Model
{
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function selectData($where){
$data = $this
->where($where)
->select();
return $data;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/8
* Time: 14:20
*/
namespace app\index\model;
use think\Model;
class RecycletypeModel extends Model
{
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function selectData($where){
$data = $this
->where($where)
->select();
return $data;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/9
* Time: 14:19
*/
namespace app\index\model;
use think\Model;
class ShopgoodsModel extends Model
{
public function getContentAttr($value){
return cmf_replace_content_file_url(htmlspecialchars_decode($value));;
}
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function getImagesAttr($value){
if(!empty($value)){
$data = explode(',',$value);
foreach($data as $key => $vo){
$data[$key] = cmf_get_image_url($vo);
}
return $data;
}
}
public function selectData($where){
$data = $this
->where($where)
->field('id,shoptype_id,goods_name,price')
->order('id desc')
->select();
return $data;
}
public function findData($where){
$data = $this->where($where)->find();
return $data;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/9
* Time: 14:56
*/
namespace app\index\model;
use think\Model;
class ShoppicModel extends Model
{
public function getThumbnailAttr($value){
return cmf_get_image_preview_url($value);
}
public function selectData($where){
$data = $this
->where($where)
->order('id desc')
->select();
return $data;
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/9
* Time: 14:22
*/
namespace app\index\model;
use think\Model;
class ShoptypeModel extends Model
{
public function selectData($where){
$data = $this
->where($where)
->select();
return $data;
}
}
\ No newline at end of file
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="environment[]" value="{filepath}">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<script type="text/html" id="photos-item-tpl">
<li id="saved-image{id}">
<input id="photo-{id}" type="hidden" name="images[]" value="{filepath}">
<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
onclick="imagePreviewDialog(this.src);">
<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
</li>
</script>
<!--<script type="text/html" id="video-item-tpl">-->
<!--<li id="saved-video{id}">-->
<!--<input id="video-{id}" type="hidden" name="video" value="{filepath}">-->
<!--<a id="video-{id}-preview" href="{:cmf_get_image_url('')}{filepath}" target="_blank">查看</a>-->
<!--<a href="javascript:uploadOne('视频上传','#video-{id}','video');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-video{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<form action="{:url('about/index')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<!--<tr class="video">-->
<!--<th>视频<span class="form-required">*</span></th>-->
<!--<td>-->
<!--<ul id="video" class="pic-list list-unstyled form-inline">-->
<!--<notempty name="$data.video">-->
<!--<li id="saved-video{$data.id}">-->
<!--<input id="video-{$data.id}" type="hidden" name="video" value="{$data.video}">-->
<!--<a id="video-{$data.id}-preview" href="{:cmf_get_image_url($data.video)}" target="_blank">查看</a>-->
<!--<a href="javascript:uploadOne('视频上传','#video-{$data.id}','video');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-video{$data.id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</notempty>-->
<!--</ul>-->
<!--<a href="javascript:uploadMultiFile('视频文件上传','#video','video-item-tpl','video');"-->
<!--class="btn btn-sm btn-default">选择视频文件</a>-->
<!--</td>-->
<!--</tr>-->
<tr>
<th width="100">公司介绍<span class="form-required">*</span></th>
<td>
<script type="text/plain" id="content" name="content">{:cmf_replace_content_file_url(htmlspecialchars_decode($data.content))}</script>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">更新</button>
<!--<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>-->
</div>
</div>
</div>
<!--<div class="col-md-3">-->
<!--<table class="table table-bordered">-->
<!--<tr>-->
<!--<th>视频封面</th>-->
<!--</tr>-->
<!--<tr>-->
<!--<td>-->
<!--<div style="text-align: center;">-->
<!--<input type="hidden" name="video_thumbnail" id="video_thumbnail"-->
<!--value="{$data.video_thumbnail|default=''}">-->
<!--<a href="javascript:uploadOneImage('image upload','#video_thumbnail');">-->
<!--<if condition="empty($data['video_thumbnail'])">-->
<!--<img src="__TMPL__/public/assets/images/default-thumbnail.png"-->
<!--id="video_thumbnail-preview"-->
<!--width="135" style="cursor: pointer"/>-->
<!--<else/>-->
<!--<img src="{:cmf_get_image_url($data.video_thumbnail)}"-->
<!--id="video_thumbnail-preview"-->
<!--width="135" style="cursor: pointer"/>-->
<!--</if>-->
<!--</a>-->
<!--<input type="button" class="btn btn-sm btn-cancel-video_thumbnail"-->
<!--value="取消图片">-->
<!--</div>-->
<!--</td>-->
<!--</tr>-->
<!--</table>-->
<!--</div>-->
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-video_thumbnail').click(function () {
$('#video_thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#video_thumbnail').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('attr/index')}">回收商品属性列表</a></li>
<li class="active"><a href="{:url('attr/add')}">添加属性</a></li>
</ul>
<form action="{:url('attr/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<th width="100">属性名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="attr_name"
id="attr_name" value="" placeholder="请输入属性名称"/>
</td>
</tr>
<tr>
<th width="100">所属商品</th>
<td>
<input class="form-control" type="text" style="width:400px;"
placeholder="请选择所属商品" onclick="rtype();" id="js-categories-name-input"
readonly value=""/>
<input class="form-control" type="hidden" name="rgoods_id"
id="js-categories-id-input"/>
</td>
</tr>
<tr>
<th width="100">属性对应价格<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="attr_price"
id="attr_price" value="" placeholder="请输入属性对应价格"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('attr/index')}">{:lang('BACK')}</a>
</div>
</div>
</table>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
function rtype() {
var selectedCategoriesId = $('#js-categories-id-input').val();
openIframeLayer("{:url('rgoods/select')}?ids=" + selectedCategoriesId, '请选择商品', {
area: ['80%', '80%'],
btn: ['确定', '取消'],
yes: function (index, layero) {
//do something
var iframeWin = window[layero.find('iframe')[0]['id']];
var selectedCategories = iframeWin.confirm();
if (selectedCategories.selectedCategoriesId.length == 0) {
layer.msg('请选择所属商品');
return;
}else if(selectedCategories.selectedCategoriesId.length >= 2){
layer.msg('只能选择一个商品');
return;
}
$('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
$('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(','));
//console.log(layer.getFrameIndex(index));
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
});
}
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('attr/index')}">回收商品属性列表</a></li>
<li class="active"><a href="{:url('attr/add')}">添加商品</a></li>
<li class="active"><a href="#">编辑信息</a></li>
</ul>
<form action="{:url('attr/edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<tr>
<th width="100">属性名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="attr_name"
id="attr_name" value="{$data.attr_name}" placeholder="请输入属性名称"/>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
<tr>
<th width="100">所属商品</th>
<td>
<input class="form-control" type="text" style="width:400px;"
placeholder="请选择所属商品" onclick="rtype();" id="js-categories-name-input"
readonly value="<foreach name='$data.rgoods' item='l'>{$l.rgoods_name}</foreach>"/>
<input class="form-control" type="hidden" name="rgoods_id" value="{$data.rgoods_id}"
id="js-categories-id-input"/>
</td>
</tr>
<tr>
<th width="100">属性对应价格<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="attr_price"
id="attr_price" value="{$data.attr_price}" placeholder="请输入属性对应价格"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="{:url('attr/index',array('keyword'=>$keyword))}">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
function rtype() {
var selectedCategoriesId = $('#js-categories-id-input').val();
openIframeLayer("{:url('rgoods/select')}?ids=" + selectedCategoriesId, '请选择分类', {
area: ['80%', '80%'],
btn: ['确定', '取消'],
yes: function (index, layero) {
//do something
var iframeWin = window[layero.find('iframe')[0]['id']];
var selectedCategories = iframeWin.confirm();
if (selectedCategories.selectedCategoriesId.length == 0) {
layer.msg('请选择所属分类');
return;
}else if(selectedCategories.selectedCategoriesId.length >= 2){
layer.msg('只能选择一个分类');
return;
}
$('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
$('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(','));
//console.log(layer.getFrameIndex(index));
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
});
}
</script>
</body>
</html>
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('attr/index')}">回收商品属性列表</a></li>
<li><a href="{:url('attr/add')}">添加属性</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('attr/index')}">
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:url('attr/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<th>ID</th>
<th>属性名称</th>
<th>所属商品</th>
<th>属性对应的价格</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$vo.id}" title="ID:{$vo.id}">
</td>
<td>{$vo.id}</td>
<td>{$vo.attr_name}</td>
<td>{$vo.rgoods_name}</td>
<td>{$vo.attr_price}元</td>
<td>
<a href='{:url("attr/edit",array("id"=>$vo["id"],"keyword"=>$keyword))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('attr/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
</head>
<body>
<script type="text/html" id="photos-item-tpl">
<li id="saved-image{id}">
<input id="photo-{id}" type="hidden" name="images[]" value="{filepath}">
<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
onclick="imagePreviewDialog(this.src);">
<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
</li>
</script>
<div class="wrap js-check-wrap">
<form action="{:url('fee/index')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th width="100">服务费<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="fee"
id="fee" value="{$data.fee}" placeholder="请输入服务费"/>
<p class="help-block">如果限时免费时,请填写0,服务费单位为%</p>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">更新</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-video_thumbnail').click(function () {
$('#video_thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#video_thumbnail').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('home/index')}">家政公司列表</a></li>
<li class="active"><a href="{:url('home/add')}">添加商品</a></li>
</ul>
<form action="{:url('home/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<th>缩略图</th>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail" id="thumbnail" value="">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
</div>
</td>
</tr>
<tr>
<th width="100">家政公司名称</th>
<td>
<input class="form-control" type="text" name="home_name"
id="home_name" value="" placeholder="请输入名称"/>
</td>
</tr>
<tr>
<th width="100">家政公司地址</th>
<td>
<input class="form-control" type="text" name="home_address"
id="home_address" value="" placeholder="请输入地址"/>
</td>
</tr>
<tr>
<th width="100">家政公司联系电话</th>
<td>
<input class="form-control" type="text" name="home_phone"
id="home_phone" value="" placeholder="请输入联系电话"/>
</td>
</tr>
<tr>
<th width="100">公司介绍<span class="form-required">*</span></th>
<td>
<script type="text/plain" id="content" name="content"></script>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('home/index')}">{:lang('BACK')}</a>
</div>
</div>
</table>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
function rtype() {
var selectedCategoriesId = $('#js-categories-id-input').val();
openIframeLayer("{:url('shoptype/select')}?ids=" + selectedCategoriesId, '请选择分类', {
area: ['80%', '80%'],
btn: ['确定', '取消'],
yes: function (index, layero) {
//do something
var iframeWin = window[layero.find('iframe')[0]['id']];
var selectedCategories = iframeWin.confirm();
if (selectedCategories.selectedCategoriesId.length == 0) {
layer.msg('请选择所属分类');
return;
}else if(selectedCategories.selectedCategoriesId.length >= 2){
layer.msg('只能选择一个分类');
return;
}
$('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
$('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(','));
//console.log(layer.getFrameIndex(index));
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
});
}
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('home/index')}">家政公司列表</a></li>
<li class="active"><a href="{:url('home/add')}">添加家政公司</a></li>
<li class="active"><a href="#">编辑信息</a></li>
</ul>
<form action="{:url('home/edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<tr>
<td>缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
value="{$data.thumbnail|default=''}">
<a href="javascript:uploadOneImage('image upload','#thumbnail');">
<if condition="empty($data['thumbnail'])">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_url($data.thumbnail)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail"
value="取消图片">
</td>
</tr>
<tr>
<th width="100">家政公司名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="home_name"
id="home_name" value="{$data.home_name}" placeholder="请输入家政公司名称"/>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
<tr>
<th width="100">家政公司地址<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="home_address"
id="home_address" value="{$data.home_address}" placeholder="请输入家政公司地址"/>
</td>
</tr>
<tr>
<th width="100">家政公司电话<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="home_phone"
id="home_phone" value="{$data.home_phone}" placeholder="请输入联系电话"/>
</td>
</tr>
<tr>
<th width="100">商品详情<span class="form-required">*</span></th>
<td>
<script type="text/plain" id="content" name="content">{:cmf_replace_content_file_url(htmlspecialchars_decode($data.content))}</script>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="{:url('home/index',array('keyword'=>$keyword))}">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
function rtype() {
var selectedCategoriesId = $('#js-categories-id-input').val();
openIframeLayer("{:url('shoptype/select')}?ids=" + selectedCategoriesId, '请选择分类', {
area: ['80%', '80%'],
btn: ['确定', '取消'],
yes: function (index, layero) {
//do something
var iframeWin = window[layero.find('iframe')[0]['id']];
var selectedCategories = iframeWin.confirm();
if (selectedCategories.selectedCategoriesId.length == 0) {
layer.msg('请选择所属分类');
return;
}else if(selectedCategories.selectedCategoriesId.length >= 2){
layer.msg('只能选择一个分类');
return;
}
$('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
$('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(','));
//console.log(layer.getFrameIndex(index));
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
});
}
</script>
</body>
</html>
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('home/index')}">家政公司列表</a></li>
<li><a href="{:url('home/add')}">添加家政公司</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('home/index')}">
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:url('home/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>ID</th>
<th>家政公司名称</th>
<th>家政公司地址</th>
<th>家政公司电话</th>
<th>家政公司图片</th>
<th>签约时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.home_name}</td>
<td>{$vo.home_address}</td>
<td>{$vo.home_phone}</td>
<td>
<notempty name="$vo.thumbnail">
<img id="photo2-{$key}-preview"
src="{:cmf_get_image_preview_url($vo['thumbnail'])}"
style="height:36px;width: 36px;"
onclick="parent.imagePreviewDialog(this.src);">
</notempty>
</td>
<td>
{:date('Y-m-d H:i:s',$vo['create_time'])}
</td>
<td>
<a href='{:url("home/service",array("id"=>$vo["id"],"keyword"=>$keyword))}'>查看服务项目 </a>|
<a href='{:url("home/edit",array("id"=>$vo["id"],"keyword"=>$keyword))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('home/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<form class="well form-inline margin-top-20" method="post" action="{:url('home/select')}">
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:url('home/select')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<th>ID</th>
<th>公司名称</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>
<php>$checked = in_array($vo['id'],explode(',',$ids))?'checked':'';</php>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$vo.id}" title="ID:{$vo.id}" data-name="{$vo.home_name}" {$checked}>
</td>
<td>{$vo.id}</td>
<td>{$vo.home_name}</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
function confirm() {
var selectedCategoriesId = [];
var selectedCategoriesName = [];
var selectedCategories = [];
$('.js-check:checked').each(function () {
var $this = $(this);
selectedCategoriesId.push($this.val());
selectedCategoriesName.push($this.data('name'));
selectedCategories.push({
id: $this.val(),
name: $this.data('name')
});
});
return {
//id,name
selectedCategories: selectedCategories,
//id
selectedCategoriesId: selectedCategoriesId,
//name
selectedCategoriesName: selectedCategoriesName
};
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('home/index',array('keyword'=>$keyword))}">返回</a></li>
<li><a href="{:url('home/index')}">家政公司列表</a></li>
<li><a href="{:url('home/add')}">添加家政公司</a></li>
<li class="active"><a href="#">服务项目列表</a></li>
</ul>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>ID</th>
<th>服务类型名称</th>
<th>所属家政公司</th>
<th>价格</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.sever_name}</td>
<td>{$vo.home_name}</td>
<td>{$vo.price}</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('HomePic/index')}">轮播图列表</a></li>
<li class="active"><a href="{:url('HomePic/add')}">添加图片</a></li>
</ul>
<form action="{:url('HomePic/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<th><b>缩略图</b><span class="form-required">*</span></th>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail" id="thumbnail" value="">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
</div>
</td>
</tr>
<tr>
<th width="100">链接地址<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="url"
id="url" value="" placeholder="请输入链接地址"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('HomePic/index')}">{:lang('BACK')}</a>
</div>
</div>
</table>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('HomePic/index')}">banner列表</a></li>
<li><a href="{:url('HomePic/add')}">添加图片</a></li>
<li class="active"><a href="#">编辑信息</a></li>
</ul>
<form action="{:url('HomePic/edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<tr>
<td>缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
value="{$data.thumbnail|default=''}">
<a href="javascript:uploadOneImage('image upload','#thumbnail');">
<if condition="empty($data['thumbnail'])">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_url($data.thumbnail)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail"
value="取消图片">
</td>
</tr>
<tr>
<th width="100">链接地址<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="url"
id="url" value="{$data.url}" placeholder="请输入链接地址"/>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('HomePic/index')}">轮播图列表</a></li>
<li><a href="{:url('HomePic/add')}">添加图片</a></li>
</ul>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<div class="table-actions">
<button class="btn btn-danger btn-sm js-ajax-submit"
data-action="{:url('HomePic/delete')}" data-subcheck="true" data-msg="你确定删除吗?">
{:lang('DELETE')}
</button>
</div>
<thead>
<tr>
<th>
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<th>ID</th>
<th>图片</th>
<th>链接地址</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$vo.id}" title="ID:{$vo.id}">
</td>
<td>{$vo.id}</td>
<td>
<notempty name="$vo.thumbnail">
<img id="photo2-{$key}-preview"
src="{:cmf_get_image_preview_url($vo['thumbnail'])}"
style="height:36px;width: 36px;"
onclick="parent.imagePreviewDialog(this.src);">
</notempty>
</td>
<td>{$vo.url}</td>
<td>
<a href='{:url("HomePic/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('HomePic/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('NoRecycle/index')}">不可回收类型列表</a></li>
<li class="active"><a href="{:url('NoRecycle/add')}">添加不可回收类型</a></li>
</ul>
<form action="{:url('NoRecycle/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<th width="100">类型名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="recycle_name"
id="recycle_name" value="" placeholder="请输入类型名称"/>
</td>
</tr>
<tr>
<th><b>缩略图</b><span class="form-required">*</span></th>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail" id="thumbnail" value="">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
</div>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('NoRecycle/index')}">{:lang('BACK')}</a>
</div>
</div>
</table>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('NoRecycle/index',array('keyword'=>$keyword))}">返回</a></li>
<li class="active"><a href="#">添加回收物</a></li>
</ul>
<form action="{:url('NoRecycle/addgoods')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<th width="100">不可回收物名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="name"
id="name" value="" placeholder="请输入不可回收物名称"/>
<input type="hidden" name="recycletype_id" value="{$data}">
</td>
</tr>
<tr>
<th><b>缩略图</b><span class="form-required">*</span></th>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail" id="thumbnail" value="">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
</div>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('NoRecycle/index',array('keyword'=>$keyword))}">{:lang('BACK')}</a>
</div>
</div>
</table>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('NoRecycle/index')}">不可回收类型列表</a></li>
<li><a href="{:url('NoRecycle/add')}">添加不可回收类型</a></li>
<li class="active"><a href="#">编辑信息</a></li>
</ul>
<form action="{:url('NoRecycle/edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<tr>
<th width="100">类型名称</th>
<td>
<input class="form-control" type="text" name="recycle_name"
id="recycle_name" value="{$data.recycle_name}" placeholder="请输入类型名称"/>
</td>
</tr>
<tr>
<td>缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
value="{$data.thumbnail|default=''}">
<a href="javascript:uploadOneImage('image upload','#thumbnail');">
<if condition="empty($data['thumbnail'])">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_url($data.thumbnail)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail"
value="取消图片">
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="{:url('NoRecycle/index',array('keyword'=>$keyword))}">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('NoRecycle/index')}">回收类型列表</a></li>
<li><a href="{:url('NoRecycle/add')}">添加类型</a></li>
<li><a href="{:url('NoRecycle/showgoods',array('id'=>$data.recycletype_id))}">回收物列表</a></li>
<li class="active"><a href="#">编辑回收物信息</a></li>
</ul>
<form action="{:url('NoRecycle/editgoods')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<tr>
<th width="100">不可回收物名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="name"
id="name" value="{$data.name}" placeholder="请输入不可回收物名称"/>
</td>
</tr>
<tr>
<td>缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
value="{$data.thumbnail|default=''}">
<a href="javascript:uploadOneImage('image upload','#thumbnail');">
<if condition="empty($data['thumbnail'])">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_url($data.thumbnail)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail"
value="取消图片">
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('NoRecycle/index')}">不可回收类型列表</a></li>
<li><a href="{:url('NoRecycle/add')}">添加不可回收类型</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('NoRecycle/index')}">
关键字:
<input type="text" class="form-control" name="keyword" style="width: 150px;" value="{$keyword|default=''}" placeholder="请输入关键字">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:url('NoRecycle/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>ID</th>
<th>类型名称</th>
<th>图片</th>
<th>创建时间</th>
<th>可回收物操作</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.recycle_name}</td>
<td>
<notempty name="$vo.thumbnail">
<img id="photo2-{$key}-preview"
src="{:cmf_get_image_preview_url($vo['thumbnail'])}"
style="height:36px;width: 36px;"
onclick="parent.imagePreviewDialog(this.src);">
</notempty>
</td>
<td>{:date('Y-m-d H:i:s',$vo.create_time)}</td>
<td>
<a href='{:url("NoRecycle/addgoods",array("id"=>$vo["id"],"keyword"=>$keyword))}'>添加不可回收物</a>|
<a href='{:url("NoRecycle/showgoods",array("id"=>$vo["id"],"keyword"=>$keyword))}'>查看不可回收物</a>
</td>
<td>
<a href='{:url("NoRecycle/edit",array("id"=>$vo["id"],"keyword"=>$keyword))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('NoRecycle/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('NoRecycle/index',array('keyword'=>$keyword))}">返回</a></li>
<li class="active"><a href="#">不可回收物列表</a></li>
</ul>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<div class="table-actions">
<button class="btn btn-danger btn-sm js-ajax-submit"
data-action="{:url('NoRecycle/deletegoods')}" data-subcheck="true" data-msg="你确定删除吗?">
{:lang('DELETE')}
</button>
</div>
<thead>
<tr>
<th>
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<th>ID</th>
<th>不可回收物名称</th>
<th>所属分类</th>
<th>图片</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$vo.id}" title="ID:{$vo.id}">
</td>
<td>{$vo.id}</td>
<td>{$vo.name}</td>
<td>{$vo.recycle_name}</td>
<td>
<notempty name="$vo.thumbnail">
<img id="photo2-{$key}-preview"
src="{:cmf_get_image_preview_url($vo['thumbnail'])}"
style="height:36px;width: 36px;"
onclick="parent.imagePreviewDialog(this.src);">
</notempty>
</td>
<td>
<a href='{:url("NoRecycle/editgoods",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('NoRecycle/deletegoods',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('pic/index')}">轮播图列表</a></li>
<li class="active"><a href="{:url('pic/add')}">添加图片</a></li>
</ul>
<form action="{:url('pic/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<th><b>缩略图</b><span class="form-required">*</span></th>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail" id="thumbnail" value="">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
</div>
</td>
</tr>
<tr>
<th width="100">链接地址<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="url"
id="url" value="" placeholder="请输入链接地址"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('pic/index')}">{:lang('BACK')}</a>
</div>
</div>
</table>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">-->
<!--<input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"-->
<!--style="width: 200px;" title="图片名称">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('pic/index')}">banner列表</a></li>
<li><a href="{:url('pic/add')}">添加图片</a></li>
<li class="active"><a href="#">编辑信息</a></li>
</ul>
<form action="{:url('pic/edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<table class="table table-bordered">
<tr>
<td>缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
value="{$data.thumbnail|default=''}">
<a href="javascript:uploadOneImage('image upload','#thumbnail');">
<if condition="empty($data['thumbnail'])">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_url($data.thumbnail)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail"
value="取消图片">
</td>
</tr>
<tr>
<th width="100">链接地址<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="url"
id="url" value="{$data.url}" placeholder="请输入链接地址"/>
<input type="hidden" name="id" value="{$data.id}">
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-thumbnail1').click(function () {
$('#thumbnail-preview1').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail1').val('');
});
});
</script>
</body>
</html>
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('pic/index')}">轮播图列表</a></li>
<li><a href="{:url('pic/add')}">添加图片</a></li>
</ul>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<div class="table-actions">
<button class="btn btn-danger btn-sm js-ajax-submit"
data-action="{:url('pic/delete')}" data-subcheck="true" data-msg="你确定删除吗?">
{:lang('DELETE')}
</button>
</div>
<thead>
<tr>
<th>
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<th>ID</th>
<th>图片</th>
<th>链接地址</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<foreach name="data" item="vo">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$vo.id}" title="ID:{$vo.id}">
</td>
<td>{$vo.id}</td>
<td>
<notempty name="$vo.thumbnail">
<img id="photo2-{$key}-preview"
src="{:cmf_get_image_preview_url($vo['thumbnail'])}"
style="height:36px;width: 36px;"
onclick="parent.imagePreviewDialog(this.src);">
</notempty>
</td>
<td>{$vo.url}</td>
<td>
<a href='{:url("pic/edit",array("id"=>$vo["id"]))}'>{:lang('EDIT')}</a>|
<a class="js-ajax-delete" href="{:url('pic/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</tbody>
</table>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...