Browse Source

adminorder

master
ZLW-PC\Administrator 7 years ago
parent
commit
fa735609ed
  1. 16
      app/Common/WechatAuth.php
  2. 8
      app/Http/Controllers/Admin/BonusController.php
  3. 186
      app/Http/Controllers/Admin/OrderController.php
  4. 1
      app/Http/Controllers/Api/OrderController.php
  5. 12
      app/Http/Controllers/Home/IndexController.php
  6. 3
      app/Http/Model/Goods.php
  7. 41
      app/Http/Model/Order.php
  8. 226
      lqycms.sql
  9. 2
      public/css/admin.css
  10. BIN
      public/images/weixin/erweima.png
  11. BIN
      public/images/weixin/wxguide.png
  12. 39
      resources/views/admin/bonus/add.blade.php
  13. 37
      resources/views/admin/bonus/edit.blade.php
  14. 30
      resources/views/admin/bonus/index.blade.php
  15. 79
      resources/views/admin/order/detail.blade.php
  16. 38
      resources/views/admin/order/index.blade.php
  17. 27
      resources/views/home/index/brandList.blade.php
  18. 2
      resources/views/weixin/common/wxshare.blade.php
  19. 33
      resources/views/weixin/order/orderList.blade.php
  20. 15
      resources/views/weixin/常用代码/分享到朋友圈箭头提示.blade.php
  21. 3
      routes/web.php

16
app/Common/WechatAuth.php

@ -66,8 +66,22 @@ class WechatAuth
return json_decode($info_data, true);
}
/**
* 获取用户基本信息(包括UnionID机制)
*
* @param string $access_token
* @param string $open_id
*/
public function get_user_unionid($access_token = '', $open_id = '')
{
$info_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token={$access_token}&openid={$open_id}&lang=zh_CN";
$info_data = $this->http($info_url);
return json_decode($info_data, true);
}
// cURL函数简单封装
function http($url, $data = null)
public function http($url, $data = null)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);

8
app/Http/Controllers/Admin/BonusController.php

@ -15,13 +15,13 @@ class BonusController extends CommonController
public function index()
{
$data['posts'] = parent::pageList('bonus', '', [['status', 'asc'], ['listorder', 'asc']]);
$data['posts'] = parent::pageList('bonus', '', [['status', 'asc']]);
if($data['posts'])
{
foreach($data['posts'] as $k=>$v)
{
$data['posts'][$k]->status_text = Bonus::getStatusText(array('status'=>$v->status));
}
}
@ -35,6 +35,8 @@ class BonusController extends CommonController
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if($_POST["start_time"]>=$_POST["end_time"]){error_jump('参数错误');}
if(DB::table('bonus')->insert(array_filter($_POST)))
{
success_jump('添加成功!', route('admin_bonus'));
@ -57,6 +59,8 @@ class BonusController extends CommonController
if(isset($_POST['editorValue'])){unset($_POST['editorValue']);}
unset($_POST["_token"]);
if($_POST["start_time"]>=$_POST["end_time"]){error_jump('参数错误');}
if(DB::table('bonus')->where('id', $id)->update($_POST))
{
success_jump('修改成功!', route('admin_bonus'));

186
app/Http/Controllers/Admin/OrderController.php

@ -7,6 +7,8 @@ use App\Http\Model\OrderGoods;
use App\Http\Model\User;
use App\Http\Model\Region;
use DB;
use App\Common\ReturnData;
use Illuminate\Http\Request;
class OrderController extends CommonController
{
@ -117,6 +119,8 @@ class OrderController extends CommonController
$data['post']['goodslist'] = $order_goods;
}
//echo '<pre>';print_r($data['post']);exit;
$data['kuaidi'] = DB::table('kuaidi')->where(['status'=>0])->orderBy('listorder', 'asc')->get();
return view('admin.order.detail', $data);
}
@ -184,4 +188,186 @@ class OrderController extends CommonController
error_jump("删除失败!请重新提交");
}
}
//发货修改物流信息
public function changeShipping(Request $request)
{
if(isset($_POST["id"]) && !empty($_POST["id"])){$id = $_POST["id"];}else{return ReturnData::create(ReturnData::PARAMS_ERROR);}
$data['shipping_id'] = $request->input('shipping_id', '');
$data['shipping_sn'] = $request->input('shipping_sn', '');
if($data['shipping_id'] == ''){return ReturnData::create(ReturnData::PARAMS_ERROR);}
if($data['shipping_id'] == 0)
{
$data['shipping_name'] = '无须物流';
unset($data['shipping_sn']);
}
else
{
if($data['shipping_sn'] == ''){return ReturnData::create(ReturnData::PARAMS_ERROR);}
$data['shipping_name'] = DB::table('kuaidi')->where('id', $data['shipping_id'])->value('name');
}
if(DB::table('order')->where(['id'=>$id,'shipping_status'=>0])->update($data) === false)
{
return ReturnData::create(ReturnData::SYSTEM_FAIL);
}
return ReturnData::create(ReturnData::SUCCESS);
}
//修改订单状态
public function changeStatus(Request $request)
{
if(isset($_POST["id"]) && !empty($_POST["id"])){$id = $_POST["id"];}else{return ReturnData::create(ReturnData::PARAMS_ERROR);}
$status = $request->input('status', '');
if($status==''){return ReturnData::create(ReturnData::PARAMS_ERROR);}
//2设为已付款,3发货,4设为已收货,7设为无效,8同意退款
if($status==2)
{
$data['pay_status'] = 1;
//...
}
elseif($status==3)
{
$data['shipping_status'] = 1;
}
elseif($status==4)
{
$data['order_status'] = 3;
$data['shipping_status'] = 2;
//...
}
elseif($status==7)
{
$data['order_status'] = 2;
//返库存
if(!Order::returnStock($id)){return ReturnData::create(ReturnData::SYSTEM_FAIL);}
}
elseif($status==8)
{
$data['refund_status'] = 2;
$order = DB::table('order')->where('id', $id)->first();
if($order->pay_money>0)
{
//返余额
//增加用户余额
DB::table('user')->where(array('id'=>$order->user_id))->increment('money', $order->pay_money);
//添加用户余额记录
DB::table('user_money')->insert(array('user_id'=>$order->user_id,'type'=>0,'money'=>$order->pay_money,'des'=>'退货-返余额','user_money'=>DB::table('user')->where(array('id'=>$order->user_id))->value('money'),'add_time'=>time()));
}
//返库存
if(!Order::returnStock($id)){return ReturnData::create(ReturnData::SYSTEM_FAIL);}
}
if(DB::table('order')->where('id', $id)->update($data) === false)
{
return ReturnData::create(ReturnData::SYSTEM_FAIL);
}
return ReturnData::create(ReturnData::SUCCESS);
}
//导出订单Excel
public function outputExcel(Request $request)
{
$res = '';
$where = function ($query) use ($res) {
if(isset($_REQUEST["keyword"]))
{
$query->where('order_sn', 'like', '%'.$_REQUEST['keyword'].'%')->orWhere("name", "like", '%'.$_REQUEST['keyword'].'%')->orWhere("mobile", "like", '%'.$_REQUEST['keyword'].'%');
}
if(isset($_REQUEST["min_addtime"]) && isset($_REQUEST["max_addtime"]) && !empty($_REQUEST["min_addtime"]) && !empty($_REQUEST["max_addtime"]))
{
$query->where('add_time', '>=', $_REQUEST['min_addtime'])->where('add_time', '<=', $_REQUEST["max_addtime"]);
}
if(isset($_REQUEST["mobile"]))
{
$query->where('mobile', 'like', '%'.$_REQUEST['mobile'].'%');
}
if(isset($_REQUEST["order_sn"]))
{
$query->where('order_sn', 'like', '%'.$_REQUEST['order_sn'].'%');
}
if(isset($_REQUEST["name"]))
{
$query->where("name", "like", '%'.$_REQUEST['name'].'%');
}
//0或者不传表示全部,1待付款,2待发货,3待收货,4待评价(确认收货,交易成功),5退款/售后
if(isset($_REQUEST["status"]))
{
if($_REQUEST["status"] == 1)
{
$query->where(array('order_status'=>0,'pay_status'=>0));
}
elseif($_REQUEST["status"] == 2)
{
$query->where(array('order_status'=>0,'shipping_status'=>0,'pay_status'=>1));
}
elseif($_REQUEST["status"] == 3)
{
$query->where(array('order_status'=>0,'refund_status'=>0,'shipping_status'=>1));
}
elseif($_REQUEST["status"] == 4)
{
$query->where(array('order_status'=>3,'refund_status'=>0));
}
elseif($_REQUEST["status"] == 5)
{
$query->where(array('order_status'=>3,'refund_status'=>1));
}
}
$query->where('is_delete', 0); //未删除
};
$cellData = [];
array_push($cellData,['ID','订单号','时间','状态','商品总价','应付金额','支付金额','收货人','地址','电话','订单来源']);
$order_list = DB::table('order')->where($where)->orderBy('id', 'desc')->get();
if($order_list)
{
foreach($order_list as $k=>$v)
{
$order_status_arr = Order::getOrderStatusText(object_to_array($v, 1));
$order_list[$k]->order_status_text = $order_status_arr?$order_status_arr['text']:'';
$order_list[$k]->order_status_num = $order_status_arr?$order_status_arr['num']:'';
$order_list[$k]->province_name = Region::getRegionName($v->province);
$order_list[$k]->city_name = Region::getRegionName($v->city);
$order_list[$k]->district_name = Region::getRegionName($v->district);
$order_list[$k]->place_type_text = Order::getPlaceTypeText(['place_type'=>$v->place_type]);
array_push($cellData,[$v->id,$v->order_sn,date('Y-m-d H:i:s',$v->add_time),$order_list[$k]->order_status_text,$v->goods_amount,$v->order_amount,$v->pay_money,$v->name,$order_list[$k]->province_name.$order_list[$k]->city_name.$order_list[$k]->district_name.' '.$v->address,$v->mobile,$order_list[$k]->place_type_text]);
}
}
//导出EXCEL
\Excel::create('订单列表',function($excel) use ($cellData){
// Set the title
$excel->setTitle('order list');
// Chain the setters
$excel->setCreator('FLi')->setCompany('FanCheng');
// Call them separately
$excel->setDescription('A demonstration to change the file properties');
//第一个工作簿,Sheet1是工作簿的名称
$excel->sheet('Sheet1', function($sheet) use ($cellData){
$sheet->rows($cellData);
});
})->download('xls');
}
}

1
app/Http/Controllers/Api/OrderController.php

@ -174,7 +174,6 @@ class OrderController extends CommonController
//判断订单是否存在或本人
$where['order_status'] = 3;
$where['refund_status'] = 0;
$where['shipping_status'] = 2;
$order = Order::where($where)->first();
if(!$order){return ReturnData::create(ReturnData::PARAMS_ERROR,null,'订单不存在');}

12
app/Http/Controllers/Home/IndexController.php

@ -33,7 +33,7 @@ class IndexController extends CommonController
//推荐
if($request->input('tuijian', '') != ''){$where['tuijian'] = $request->input('tuijian');}
if($request->input('brand_id', '') != ''){$where['brand_id'] = $request->input('brand_id');}
if($request->input('brand_id', '') != ''){$where['brand_id'] = $request->input('brand_id');DB::table('goods_brand')->where(array('id'=>$where['brand_id']))->increment('click', 1);}
$pagenow = $page;
$post = '';
@ -90,9 +90,19 @@ class IndexController extends CommonController
}
$data['tj_list'] = object_to_array(DB::table('goods')->where(['tuijian'=>1,'status'=>0])->get());
DB::table('goods')->where(array('id'=>$id))->increment('click', 1);
return view('home.index.goods', $data);
}
//商品列表页
public function brandList(Request $request)
{
$data['brand_list'] = object_to_array(DB::table('goods_brand')->where(['status'=>0])->take(30)->orderBy('listorder','asc')->get());
return view('home.index.brandList', $data);
}
//网址组装
public function listpageurl($http_host,$query_string,$page=0)
{

3
app/Http/Model/Goods.php

@ -272,9 +272,10 @@ class Goods extends BaseModel
//增加或减少商品库存
public static function changeGoodsStock(array $param)
{
//$param['type']=1减库存
extract($param);
if(isset($type))
if(isset($type) && $type==1)
{
//增加库存
DB::table('goods')->where(array('id'=>$goods_id))->increment('goods_number', $goods_number);

41
app/Http/Model/Order.php

@ -24,6 +24,8 @@ class Order extends BaseModel
$limit = isset($limit) ? $limit : 10;
$offset = isset($offset) ? $offset : 0;
$model = new self();
if(isset($user_id)){$where['user_id'] = $user_id;}
$where['is_delete'] = 0;
@ -56,10 +58,10 @@ class Order extends BaseModel
elseif($status == 5)
{
$where['order_status'] = 3;
$where['refund_status'] = 1;
$model = $model->where('refund_status','<>',0);
}
$model = self::where($where);
$model = $model->where($where);
$res['count'] = $model->count();
$res['list'] = array();
@ -203,7 +205,7 @@ class Order extends BaseModel
);
array_push($order_goods_list,$temp_order_goods);
//订单商品直减库存操作
//订单商品直减库存操作
Goods::changeGoodsStock(array('goods_id'=>$v['goods_id'],'goods_number'=>$v['goods_number']));
}
$result = DB::table('order_goods')->insert($order_goods_list);
@ -269,7 +271,7 @@ class Order extends BaseModel
}
elseif($where['order_status'] == 3 && $where['refund_status'] == 1)
{
$res = array('text'=>'售后','num'=>5);
$res = array('text'=>'售后','num'=>5);
}
elseif($where['order_status'] == 1)
{
@ -279,6 +281,10 @@ class Order extends BaseModel
{
$res = array('text'=>'无效','num'=>7);
}
elseif($where['order_status'] == 3 && $where['refund_status'] == 2)
{
$res = array('text'=>'退款成功','num'=>8);
}
return $res;
}
@ -326,4 +332,31 @@ class Order extends BaseModel
return $res;
}
//根据订单id返库存
public static function returnStock($order_id)
{
$order_goods = OrderGoods::where(array('order_id'=>$order_id))->get();
if(!$order_goods){return false;}
foreach($order_goods as $k=>$v)
{
//订单商品直接返库存
Goods::changeGoodsStock(array('goods_id'=>$v['goods_id'],'goods_number'=>$v['goods_number'],'type'=>1));
}
return true;
}
//订单超时,设为无效
public static function orderSetInvalid($order_id)
{
$order = self::where(array('id'=>$order_id,'order_status'=>0,'pay_status'=>0))->update(['order_status'=>2]);
if(!$order){return false;}
//返库存
self::returnStock($order_id);
return true;
}
}

226
lqycms.sql
File diff suppressed because it is too large
View File

2
public/css/admin.css

@ -1,4 +1,4 @@
.mauto{margin-left:auto;margin-right:auto;}
.mauto{margin-left:auto;margin-right:auto;}.mt10{margin-top:10px;}.mb10{margin-bottom:10px;}
.blog-masthead{background-color:#01aef0;}
.blog-nav-item{position:relative;display:inline-block;padding:12px 20px;font-weight:500;color:#fff;font-size:16px;}

BIN
public/images/weixin/erweima.png

Binary file not shown.

After

Width: 430  |  Height: 430  |  Size: 23 KiB

BIN
public/images/weixin/wxguide.png

Binary file not shown.

After

Width: 330  |  Height: 228  |  Size: 24 KiB

39
resources/views/admin/bonus/add.blade.php

@ -1,49 +1,44 @@
@extends('admin.layouts.app')
@section('title', '快递添加')
@section('title', '优惠券添加')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_kuaidi'); ?>">快递列表</a> > 添加快递</h5>
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/My97DatePicker/WdatePicker.js"></script>
<h5 class="sub-header"><a href="<?php echo route('admin_bonus'); ?>">优惠券列表</a> > 添加优惠券</h5>
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right" width="150px">快递名称:</td>
<td><input name="name" type="text" id="name" value="" class="required" style="width:30%" placeholder="在此输入关键词"></td>
</tr>
<tr>
<td align="right">编码:</td>
<td><input name="code" type="text" id="code" value="" size="15" class="required"></td>
<td align="right" width="150px">名称:</td>
<td><input name="name" type="text" id="name" value="" class="required" style="width:30%" placeholder="在此输入名称"></td>
</tr>
<tr>
<td align="right">金额:</td>
<td><input name="money" type="text" id="money" value="0" size="10"></td>
<td><input name="money" type="text" id="money" value="0" size="10" class="required"></td>
</tr>
<tr>
<td align="right">说明</td>
<td><input name="des" type="text" id="des" value="" style="width:60%"></td>
<td align="right">满多少使用</td>
<td><input name="min_amount" type="text" id="min_amount" value="0" size="10" class="required"></td>
</tr>
<tr>
<td align="right">电话</td>
<td><input name="tel" type="text" id="tel" value="" size="15"></td>
<td align="right">数量</td>
<td><input name="num" type="text" id="num" value="-1" size="5" class="required"> (-1表示不限)</td>
</tr>
<tr>
<td align="right">官网:</td>
<td><input name="website" type="text" id="website" value="" size="30"></td>
<td align="right">期限:</td>
<td>
起:<input class="required" value="" size="18" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" id="start_time" name="start_time" placeholder="开始时间"> -
止:<input class="required" value="" size="18" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" id="end_time" name="end_time" placeholder="结束时间">
</td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td align="right">是否可用</td>
<td>
<input type="radio" value='0' name="status" checked />&nbsp;&nbsp;&nbsp;
<input type="radio" value='1' name="status" />&nbsp;
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="listorder" type="text" id="listorder" value="50" size="3" />
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>

37
resources/views/admin/bonus/edit.blade.php

@ -1,49 +1,44 @@
@extends('admin.layouts.app')
@section('title', '快递修改')
@section('title', '优惠券修改')
@section('content')
<h5 class="sub-header"><a href="<?php echo route('admin_kuaidi'); ?>">快递列表</a> > 快递修改</h5>
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/My97DatePicker/WdatePicker.js"></script>
<h5 class="sub-header"><a href="<?php echo route('admin_bonus'); ?>">优惠券列表</a> > 优惠券修改</h5>
<form id="addarc" method="post" action="" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td align="right" width="150px">快递名称:</td>
<td><input name="name" type="text" id="name" value="<?php echo $post['name']; ?>" class="required" style="width:30%" placeholder="在此输入关键词"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">编码:</td>
<td><input name="code" type="text" id="code" value="<?php echo $post['code']; ?>" size="15" class="required"></td>
<td align="right" width="150px">名称:</td>
<td><input name="name" type="text" id="name" value="<?php echo $post['name']; ?>" class="required" style="width:30%" placeholder="在此输入名称"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
</tr>
<tr>
<td align="right">金额:</td>
<td><input name="money" type="text" id="money" value="<?php echo $post['money']; ?>" size="10"></td>
</tr>
<tr>
<td align="right">说明</td>
<td><input name="des" type="text" id="des" value="<?php echo $post['des']; ?>" style="width:60%"></td>
<td align="right">满多少使用</td>
<td><input name="min_amount" type="text" id="min_amount" value="<?php echo $post['min_amount']; ?>" size="10"></td>
</tr>
<tr>
<td align="right">电话</td>
<td><input name="tel" type="text" id="tel" value="<?php echo $post['tel']; ?>" size="15"></td>
<td align="right">数量</td>
<td><input name="num" type="text" id="num" value="<?php echo $post['num']; ?>" size="5"> (-1表示不限)</td>
</tr>
<tr>
<td align="right">官网:</td>
<td><input name="website" type="text" id="website" value="<?php echo $post['website']; ?>" size="30"></td>
<td align="right">期限:</td>
<td>
起:<input value="<?php echo $post['start_time']; ?>" size="18" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" id="start_time" name="start_time" placeholder="开始时间"> -
止:<input value="<?php echo $post['end_time']; ?>" size="18" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" id="end_time" name="end_time" placeholder="结束时间">
</td>
</tr>
<tr>
<td align="right">是否显示:</td>
<td align="right">是否可用</td>
<td>
<input type="radio" value='0' name="status" <?php if(isset($post['status']) && $post['status']==0){echo 'checked';} ?> />&nbsp;是&nbsp;&nbsp;
<input type="radio" value='1' name="status" <?php if(isset($post['status']) && $post['status']==1){echo 'checked';} ?> />&nbsp;否
</td>
</tr>
<tr>
<td align="right">排序:</td>
<td>
<input name="listorder" type="text" id="listorder" value="<?php echo $post['listorder']; ?>" size="3" />
</td>
</tr>
<tr>
<td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button></td>
</tr>

30
resources/views/admin/bonus/index.blade.php

@ -1,34 +1,32 @@
@extends('admin.layouts.app')
@section('title', '快递列表')
@section('title', '优惠券列表')
@section('content')
<h2 class="sub-header">快递管理</h2>[ <a href="<?php echo route('admin_kuaidi_add'); ?>">添加快递</a> ]<br><br>
<h2 class="sub-header">优惠券管理</h2>[ <a href="<?php echo route('admin_bonus_add'); ?>">添加优惠券</a> ]<br><br>
<form name="listarc"><div class="table-responsive"><table class="table table-hover">
<thead><tr class="info">
<th>ID</th>
<th>快递名称</th>
<th>编码</th>
<th>名称</th>
<th>金额</th>
<th>说明</th>
<th>电话</th>
<th>官网</th>
<th>排序</th>
<th>是否显示</th>
<th>满多少使用</th>
<th>开始领取时间</th>
<th>结束领取时间</th>
<th>数量</th>
<th>状态</th>
<th>管理</th>
</tr></thead>
<tbody>
<?php if($posts){foreach($posts as $row){ ?><tr>
<td><?php echo $row->id; ?></td>
<td><?php echo $row->name; ?></td>
<td><?php echo $row->code; ?></td>
<td><?php echo $row->money; ?></td>
<td><?php echo $row->des; ?></td>
<td><?php echo $row->tel; ?></td>
<td><?php echo $row->website; ?></td>
<td><?php echo $row->listorder; ?></td>
<td><?php if($row->status==0){echo "";}else{echo "<font color=red></font>";} ?></td>
<td><a href="<?php echo route('admin_kuaidi_edit',array('id'=>$row->id)); ?>">修改</a> | <a onclick="delconfirm('<?php echo route('admin_kuaidi_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td>
<td><?php echo $row->min_amount; ?></td>
<td><?php echo $row->start_time; ?></td>
<td><?php echo $row->end_time; ?></td>
<td><?php if($row->num==-1){echo "不限";}else{echo "<font color=red>".$row->num."</font>";} ?></td>
<td><?php if($row->status==0){echo "可用";}else{echo "<font color=red>不可用</font>";} ?></td>
<td><a href="<?php echo route('admin_bonus_edit',array('id'=>$row->id)); ?>">修改</a> | <a onclick="delconfirm('<?php echo route('admin_bonus_del',array('id'=>$row->id)); ?>')" href="javascript:;">删除</a></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->

79
resources/views/admin/order/detail.blade.php

@ -1,21 +1,92 @@
@extends('admin.layouts.app')
@section('title', '订单列表')
@section('title', '订单详情')
@section('content')
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/layer/layer.js"></script>
<div class="bg-info" style="margin:10px 0;padding:10px;">
<div class="form-inline">
<div class="form-group">
当前可执行操作:
</div>
<button class="btn btn-info" onclick="show_search()">发货</button>
<button class="btn btn-success">设为已付款</button>
<button class="btn btn-danger" onclick="show_search()">设为无效</button>
<?php if($post['order_status'] == 0 && $post['shipping_status'] == 0 && $post['pay_status'] == 1){ ?><button class="btn btn-info" onclick="fahuo_layer(<?php echo $post['id']; ?>)">发货</button><?php } ?>
<?php if($post['order_status'] == 0 && $post['pay_status'] == 0){ ?><button class="btn btn-success" onclick="change_status(<?php echo $post['id']; ?>,2)">设为已付款</button><?php } ?>
<?php if($post['order_status'] == 0 && $post['refund_status'] == 0 && $post['shipping_status'] == 1 && $post['pay_status'] == 1){ ?><button class="btn btn-primary" onclick="change_status(<?php echo $post['id']; ?>,4)">设为已收货</button><?php } ?>
<?php if($post['order_status'] == 0 && $post['pay_status'] == 0){ ?><button class="btn btn-danger" onclick="change_status(<?php echo $post['id']; ?>,7)">设为无效</button><?php } ?>
<?php if($post['order_status'] == 3 && $post['refund_status'] == 1){ ?><button class="btn btn-danger" onclick="change_status(<?php echo $post['id']; ?>,8)">设为已退货</button><?php } ?>
<button class="btn btn-warning" onclick="javascript:history.back(-1);">返回</button>
</div>
<div style="clear:both;"></div>
</div>
<script>
function fahuo_layer(order_id)
{
//自定页
layer.open({
title: '发货管理',
shadeClose: true, //开启遮罩关闭
content: '快递方式:<select name="shipping_id" id="shipping_id"><option value="0">无须物流</option><?php if($kuaidi){foreach($kuaidi as $k=>$v){ ?><option value="<?php echo $v->id ?>"><?php echo $v->name ?></option><?php }} ?></select><br>快递单号:<input size="30" type="text" name="shipping_sn" id="shipping_sn" placeholder="">'
,btn: ['确认', '取消']
,yes: function(index, layero){
var shipping_id = $("#shipping_id").val();
var shipping_sn = $("#shipping_sn").val();
if(shipping_id!=0){if(shipping_sn==''){layer.msg('请填写快递单号');return false;}}
$.post('<?php echo route('admin_order_change_shipping'); ?>',{id:order_id,shipping_id:shipping_id,shipping_sn:shipping_sn},function(res)
{
if(res.code==0)
{
$.post('<?php echo route('admin_order_change_status'); ?>',{id:order_id,status:3},function(res)
{
if(res.code==0)
{
layer.msg('操作成功');
window.location.reload();
}
else
{
layer.msg('操作失败');
return false;
}
},'json');
}
else
{
layer.msg('操作失败');
return false;
}
},'json');
layer.close(index);
}
,btn2: function(index, layero){
}
,cancel: function(){
//右上角关闭回调
}
});
}
function change_status(order_id,status)
{
$.post('<?php echo route('admin_order_change_status'); ?>',{id:order_id,status:status},function(res)
{
if(res.code==0)
{
layer.msg('操作成功');
window.location.reload();
}
else
{
layer.msg('操作失败');
return false;
}
},'json');
}
</script>
<h3 class="sub-header">基本信息</h3>
<!-- 表格开始 -->

38
resources/views/admin/order/index.blade.php

@ -3,6 +3,7 @@
@section('content')
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="http://<?php echo env('APP_DOMAIN'); ?>/js/layer/layer.js"></script>
<form name="listarc" action="" method="get">
<div class="bg-info" style="margin:10px 0;padding:10px;">
@ -16,19 +17,32 @@
<input size="5" type="text" class="form-control" id="name" name="name" placeholder="">
</div>
<button type="submit" class="btn btn-success">查询</button>
<button class="btn btn-warning" onclick="show_search()">高级</button>
</div>
<div class="form-inline" style="display:inline;float:right;">
<div class="form-group">
<label for="min_addtime">导出列表:</label>
<input size="15" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="form-control" id="min_addtime" name="min_addtime" placeholder="开始时间">
</div>
<div class="form-group">
<input size="15" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="form-control" id="max_addtime" name="max_addtime" placeholder="结束时间">
</div>
<button onclick="javascript:output();" class="btn btn-success">导出</button>
<button type="button" onclick="output_excel()" class="btn btn-warning">导出EXCEL</button>
</div>
<script>
function output_excel()
{
layer.open({
title: '导出EXCEL',
area: ['400px', '360px'],
shadeClose: true, //开启遮罩关闭
content: '<form id="output-excel" action="<?php echo route('admin_order_output_excel'); ?>" method="get"><div class="form-inline"><div class="form-group"><label for="min_addtime">时 间:</label><input size="18" onclick="WdatePicker({el:this,dateFmt:\'yyyy-MM-dd HH:mm:ss\'})" type="text" class="form-control" id="min_addtime" name="min_addtime" placeholder="开始时间"></div> - <div class="form-group"><input size="18" onclick="WdatePicker({el:this,dateFmt:\'yyyy-MM-dd HH:mm:ss\'})" type="text" class="form-control" id="max_addtime" name="max_addtime" placeholder="结束时间"></div></div><div class="form-inline mt10"><div class="form-group"><label for="num">数 量:</label><input size="4" type="text" class="form-control" id="num" name="num" value="100" placeholder=""></div></div><div class="form-inline mt10"><div class="form-group"><label for="status">订单状态:</label><select id="status" class="form-control" name="status"><option value ="0">全部</option><option value ="1">待付款</option><option value="2">待发货</option><option value="3">待收货</option><option value="4">交易成功</option><option value="5">退款中</option></select></div></div><div class="form-inline mt10"><div class="form-group"><label for="name">收货人:</label><input size="8" type="text" class="form-control" id="name" name="name" placeholder=""></div></div><div class="form-inline mt10"><div class="form-group"><label for="order_sn">订单号:</label><input size="20" type="text" class="form-control" id="order_sn" name="order_sn" placeholder=""></div></div></form>'
,btn: ['导出', '取消']
,yes: function(index, layero){
$('#output-excel').submit();
layer.close(index);
}
,btn2: function(index, layero){
}
,cancel: function(){
//右上角关闭回调
}
});
}
</script>
<div style="clear:both;"></div>
</div>

27
resources/views/home/index/brandList.blade.php

@ -0,0 +1,27 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title><?php echo sysconfig('CMS_WEBNAME'); ?></title><meta name="keywords" content="{dede:field.keywords/}" /><meta name="description" content="{dede:field.description function='html2text(@me)'/}" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css"></head><body>
@include('home.common.header')
<style>
.brandul{margin-right:-10px;}
.brandul li{margin: 0 10px 10px 0;-webkit-box-shadow: 0 1px 0 rgba(0,0,0,.1);-moz-box-shadow: 0 1px 0 rgba(0,0,0,.1);box-shadow: 0 1px 0 rgba(0,0,0,.1);float: left;}
.brandul li a{display: block;overflow: hidden;width: 100%;height: 100%;text-decoration: none;}
.brandul li .brand-pic{width: 475px;height: 186px;}
.brandul .brand-des{vertical-align: top;line-height: 26px;height: 26px;padding-left: 10px;border-left: 1px solid #F3F3F3;border-right: 1px solid #F3F3F3;color: #000;}
.brandul .brand-des em{color:#e61414;}
.brandul .brand-des .fl{margin-left:10px;}
.brandul .brand-des .fr{margin-right:20px;}
</style>
<div class="box" style="margin-bottom:5px;margin-top:10px;">
<ul class="brandul">
<?php if($brand_list){foreach($brand_list as $k=>$v){ ?>
<li>
<a href="<?php echo route('home_goodslist',array('brand_id'=>$v['id'])); ?>" target="_blank">
<img class="brand-pic" src="<?php echo $v['litpic']; ?>">
<div class="brand-des"><span class="fl"></span>
<span class="fr"><em><?php echo $v['click']; ?></em>件已付款 &nbsp; <em>仅剩1天</em></span></div></a>
</li><?php }} ?>
</ul></div>
@include('home.common.footer')
</body></html>

2
resources/views/weixin/common/wxshare.blade.php

@ -4,7 +4,7 @@ $jssdk = new \JSSDK(sysconfig('CMS_WX_APPID'), sysconfig('CMS_WX_APPSECRET'));
$signPackage = $jssdk->GetSignPackage();
?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
<script type="text/javascript">
/*
* 注意:
* 1. 所有的JS接口只能在公众号绑定的域名下调用,公众号开发者需要先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”。

33
resources/views/weixin/order/orderList.blade.php

@ -51,7 +51,7 @@ var swiper = new Swiper('.swiper-nav', {
</a>
<p class="des">合计: <?php echo $value['order_amount']; ?> <small>(含运费:¥<?php echo $value['shipping_fee']; ?>)</small></p>
<div class="tag"><?php if($value['order_status_num']==4 || $value['order_status_num']==6 || $value['order_status_num']==7){ ?><a href="javascript:del_order(<?php echo $value['id']; ?>);">删除</a><?php } ?><?php if($value['order_status_num']==1){ ?><a href="javascript:cancel_order(<?php echo $value['id']; ?>);">取消订单</a><?php } ?><?php if($value['order_status_num']==1){ ?><a href="<?php echo route('weixin_order_pay',array('id'=>$value['id'])); ?>">付款</a><?php } ?><?php if($value['order_status_num']==3){ ?><a href="http://m.kuaidi100.com/index_all.html?type=<?php echo $value['shipping_name']; ?>&postid=<?php echo $value['shipping_sn']; ?>#result">查看物流</a><?php } ?><?php if($value['order_status_num']==3){ ?><a href="javascript:done_order(<?php echo $value['id']; ?>);">确认收货</a><?php } ?><?php if($value['order_status_num']==4){ ?><a class="activate" href="<?php echo route('weixin_order_comment',array('id'=>$value['id'])); ?>">评价</a><?php } ?></div>
<div class="tag"><?php if($value['order_status_num']==4){ ?><a href="javascript:refund_order(<?php echo $value['id']; ?>);">申请退款</a><?php } ?><?php if($value['order_status_num']==4 || $value['order_status_num']==6 || $value['order_status_num']==7){ ?><a href="javascript:del_order(<?php echo $value['id']; ?>);">删除</a><?php } ?><?php if($value['order_status_num']==1){ ?><a href="javascript:cancel_order(<?php echo $value['id']; ?>);">取消订单</a><?php } ?><?php if($value['order_status_num']==1){ ?><a href="<?php echo route('weixin_order_pay',array('id'=>$value['id'])); ?>">付款</a><?php } ?><?php if($value['order_status_num']==3){ ?><a href="http://m.kuaidi100.com/index_all.html?type=<?php echo $value['shipping_name']; ?>&postid=<?php echo $value['shipping_sn']; ?>#result">查看物流</a><?php } ?><?php if($value['order_status_num']==3){ ?><a href="javascript:done_order(<?php echo $value['id']; ?>);">确认收货</a><?php } ?><?php if($value['order_status_num']==4){ ?><a class="activate" href="<?php echo route('weixin_order_comment',array('id'=>$value['id'])); ?>">评价</a><?php } ?></div>
</div>
<?php }}else{ ?>
<div style="text-align:center;line-height:40px;color:#999;">暂无记录</div>
@ -169,5 +169,36 @@ function del_order(order_id)
}
});
}
//申请退款
function refund_order(order_id)
{
//询问框
layer.open({
content: '确定要申请退款吗?'
,btn: ['确定', '取消']
,yes: function(){
var url = '<?php echo env('APP_API_URL')."/order_status_update"; ?>';
$.post(url,{access_token:access_token,id:order_id,type:4},function(res)
{
//提示
layer.open({
content: res.msg
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
if(res.code==0)
{
location.reload();
}
else
{
}
},'json');
}
});
}
</script>
</body></html>

15
resources/views/weixin/常用代码/分享到朋友圈箭头提示.blade.php

@ -0,0 +1,15 @@
<!DOCTYPE html><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>分享到朋友圈提示</title><meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<link href="<?php echo env('APP_URL'); ?>/css/weixin/style.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<?php echo env('APP_URL'); ?>/js/jquery.min.js"></script>
<meta name="keywords" content="关键词"><meta name="description" content="描述"></head><body>
<!-- 分享到朋友圈提示-start --><a href="javascript:;" onclick="document.getElementById('sharewxtip').style.display='block';">分享给朋友</a>
<div id="sharewxtip" onclick="document.getElementById('sharewxtip').style.display='';" style="display:none;">
<img src="<?php echo env('APP_URL'); ?>/images/weixin/wxguide.png">
</div>
<style>
#sharewxtip {position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.7);display: none;z-index: 20000;}
#sharewxtip img {position: fixed;right: 18px;top: 5px;width: 260px;height: 180px;z-index: 999;}
</style>
<!-- 分享到朋友圈提示-end -->
</body></html>

3
routes/web.php

@ -301,6 +301,9 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
Route::get('/order/edit', 'OrderController@edit')->name('admin_order_edit');
Route::post('/order/doedit', 'OrderController@doedit')->name('admin_order_doedit');
Route::get('/order/del', 'OrderController@del')->name('admin_order_del');
Route::any('/order/output_excel', 'OrderController@outputExcel')->name('admin_order_output_excel');
Route::post('/order/change_shipping', 'OrderController@changeShipping')->name('admin_order_change_shipping');
Route::post('/order/change_status', 'OrderController@changeStatus')->name('admin_order_change_status');
//快递管理
Route::get('/kuaidi', 'KuaidiController@index')->name('admin_kuaidi');
Route::any('/kuaidi/add', 'KuaidiController@add')->name('admin_kuaidi_add');

Loading…
Cancel
Save