This commit is contained in:
parent
4d411a2419
commit
5bb831615e
|
|
@ -45,7 +45,7 @@ class OrderController extends Controller
|
|||
|
||||
//订单类型
|
||||
if (isset($param['order_type']) && $param['order_type'] != '') {
|
||||
$where[] = ['o.order_type', '=', $param['order_type']];
|
||||
$where[] = ['o.order_status', '=', $param['order_type']];
|
||||
}
|
||||
|
||||
//下单时间
|
||||
|
|
|
|||
|
|
@ -0,0 +1,189 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\model\User;
|
||||
use app\common\model\ShopConfig;
|
||||
use app\common\model\Cart;
|
||||
use app\common\model\Goods;
|
||||
use Exception;
|
||||
use think\Request;
|
||||
use think\response\Json;
|
||||
use tools\Crypt;
|
||||
|
||||
class CartController extends Controller
|
||||
{
|
||||
/**
|
||||
* 添加购物车
|
||||
*/
|
||||
public function add(Request $request,Cart $cmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$goods_id = $param['goods_id']?Crypt::decrypt($param['goods_id']):'';
|
||||
if(!$goods_id){
|
||||
return client_error('该商品不存在');
|
||||
}
|
||||
$item_value=$param['item_value']??'';
|
||||
if(!$item_value){
|
||||
return client_error('请选择规格');
|
||||
}
|
||||
$goods_num=$param['goods_num']??'0';
|
||||
if($goods_num=='0'){
|
||||
return client_error('购买数量必须大于0');
|
||||
}
|
||||
$time = time();
|
||||
$where = [
|
||||
'user_id' => $user_id,
|
||||
'goods_id' => $goods_id,
|
||||
'item_value' => $item_value,
|
||||
];
|
||||
$info = Cart::where($where)->find();
|
||||
|
||||
$cart_num = $param['goods_num'] + (isset($info) ? $info['goods_num'] : 0);
|
||||
|
||||
if ($cmodel->checkStock($item_value, $cart_num,$goods_id)) {
|
||||
return client_error('很抱歉,商品库存不足');
|
||||
}
|
||||
if ($info) {
|
||||
//购物车内已有该商品
|
||||
$update_data = [
|
||||
'goods_num' => $goods_num + $info['goods_num'],
|
||||
'update_time' => $time,
|
||||
];
|
||||
$res =$cmodel
|
||||
->where('id', $info['id'])
|
||||
->update($update_data);
|
||||
} else {
|
||||
//新增购物车记录
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
'goods_id' => $goods_id,
|
||||
'goods_num' => $goods_num,
|
||||
'item_value' => $item_value,
|
||||
'create_time' => $time,
|
||||
];
|
||||
$res = $cmodel->insert($data);
|
||||
}
|
||||
return $res ? success('','添加成功') : client_error('添加失败');
|
||||
}
|
||||
|
||||
//删除购物车
|
||||
public function del(Request $request,Cart $cmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$cart_id= $param['cart_id']?Crypt::decrypt($param['cart_id']):'0';
|
||||
if($cart_id=='0'){
|
||||
return client_error('该购物车商品不存在');
|
||||
}
|
||||
$res = $cmodel->whereIn('id',$cart_id)->delete();
|
||||
return $res ? success('','删除成功') : client_error('删除失败');
|
||||
}
|
||||
|
||||
//变动购物车数量
|
||||
public function change(Request $request,Cart $cmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$cart_id=$param['cart_id']?Crypt::decrypt($param['cart_id']):'0';
|
||||
if($cart_id=='0'){
|
||||
return client_error('该购物车商品不存在');
|
||||
}
|
||||
$goods_num=$param['goods_num']??'0';
|
||||
if($goods_num=='0'){
|
||||
return client_error('购买数量必须大于0');
|
||||
}
|
||||
$cart = $cmodel->where(['id' => $cart_id])->find();
|
||||
if ($cmodel->checkStock($cart['item_value'], $goods_num,$cart['goods_id'])) {
|
||||
return client_error('很抱歉,商品库存不足');
|
||||
}
|
||||
$update = [
|
||||
'update_time' => time(),
|
||||
'goods_num' => $goods_num,
|
||||
];
|
||||
$res = $cmodel->where(['id' => $cart_id])->update($update);
|
||||
return $res ? success('','更新成功') : client_error('更新失败');
|
||||
}
|
||||
|
||||
//购物车选中状态
|
||||
public function selected(Request $request,Cart $cmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$cart_id=$param['cart_id']?Crypt::decrypt($param['cart_id']):'0';
|
||||
if($cart_id=='0'){
|
||||
return client_error('该购物车商品不存在');
|
||||
}
|
||||
$res = $cmodel->where(['id' => $cart_id, 'user_id' => $user_id])
|
||||
->update(['selected' => $param['selected'], 'update_time' => time()]);
|
||||
return $res ? success('','更新成功') : client_error('更新失败');
|
||||
}
|
||||
|
||||
//列表
|
||||
public function lists(Request $request,Cart $cmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$carts =$cmodel
|
||||
->alias('c')
|
||||
->field("mi.thumb_image as img,g.name,g.price,g.id as goods_id,gb.name as brand_name,c.goods_num,c.selected,c.id as cart_id,item_value")
|
||||
->join('goods g', 'g.id = c.goods_id')
|
||||
->join('goods_brand gb', 'gb.id= g.brand_id')
|
||||
->join('mall_image mi', 'mi.union_id= c.goods_id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->where('c.user_id', $user_id)
|
||||
->order('c.create_time desc')
|
||||
->select();
|
||||
$goods_num = 0;
|
||||
$total = 0;
|
||||
$lists = [];
|
||||
foreach ($carts as $k1 => $cart) {
|
||||
$cart['goods_id'] = Crypt::encrypt($cart['goods_id']);
|
||||
$cart['cart_id'] =Crypt::encrypt($cart['cart_id']);
|
||||
$cart['img'] = $this->img_url.$cart['img'];
|
||||
$cart['sub_price'] = 0;
|
||||
if ($cart['selected'] ==1) {
|
||||
$goods_num += $cart['goods_num'];
|
||||
$total += $cart['price'] * $cart['goods_num'];
|
||||
$cart['sub_price'] = round($cart['price'] * $cart['goods_num'], 2);
|
||||
}
|
||||
$cart['selected'] = intval($cart['selected']);
|
||||
$lists[] = $cart;
|
||||
}
|
||||
$data=[
|
||||
'lists' => $lists,
|
||||
'total_amount' => round($total, 2),
|
||||
'total_num' => $goods_num,
|
||||
];
|
||||
return success($data);
|
||||
}
|
||||
|
||||
//获取购物车数量
|
||||
public function cartnum(Request $request,Cart $cmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$num = $cmodel->where('user_id', $user_id)->sum('goods_num');
|
||||
$data=['num' => $num ?? 0];
|
||||
return success($data);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,246 @@
|
|||
<?php
|
||||
/**
|
||||
* @author yupoxiong<i@yufuping.com>
|
||||
* @title 首页
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
use app\common\model\Goodsindex;
|
||||
use app\common\model\Goods;
|
||||
use app\common\model\GoodsBrand;
|
||||
use app\common\model\GoodsItem;
|
||||
use app\common\model\GoodsCategory;
|
||||
use app\common\model\MallImage;
|
||||
use app\common\model\ShopConfig;
|
||||
use app\common\model\PhaseConfig;
|
||||
use app\common\model\GoodsCollect;
|
||||
use tools\Crypt;
|
||||
use think\Request;
|
||||
class GoodsController extends Controller
|
||||
{
|
||||
|
||||
protected $authExcept = [
|
||||
'goods_info','goods_list','category_list'
|
||||
];
|
||||
|
||||
//商品列表
|
||||
public function goods_list(Request $request,Goods $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$size=$param['size']>0?$param['size']:12;
|
||||
$page_l=$param['page']>1?$param['page']:1;
|
||||
$page=$size * ($page_l - 1);
|
||||
$where[]=array('status','=',1);
|
||||
$where[]=array('gi.stock','>',0);
|
||||
$keyword = $param['keyword']??'';
|
||||
$where1='';
|
||||
if($keyword){
|
||||
foreach ($keyword as $v1) {
|
||||
$where1.="( `spec_value` LIKE '%".$v1."%' OR `gb`.`name` LIKE '%".$v1."%' OR `gc`.`name` LIKE '%".$v1."%') or";
|
||||
}
|
||||
$where1=rtrim($where1,'or');
|
||||
}
|
||||
$sort=$param['sort']??'asc';
|
||||
$order=$param['order']??'g.sort_number';
|
||||
$goods_count = $model
|
||||
->alias('g')
|
||||
->where($where)
|
||||
->where($where1)
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->join('goods_item gi', 'gi.goods_id = g.id')
|
||||
->join('goods_category gc', 'gc.id = g.goods_category_id')
|
||||
->group('g.id')
|
||||
->count();
|
||||
$totalPages = ceil($goods_count / $size);
|
||||
$goods_list = $model
|
||||
->alias('g')
|
||||
->field("mi.thumb_image as img, g.name,g.price,g.id as goods_id,gb.name as brand_name")
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->join('goods_item gi', 'gi.goods_id = g.id')
|
||||
->join('goods_category gc', 'gc.id = g.goods_category_id')
|
||||
->where($where)
|
||||
->where($where1)
|
||||
->limit($page, $size)
|
||||
->group('g.id')
|
||||
->order($order.' '.$sort)
|
||||
->select();
|
||||
if (!$goods_list) {
|
||||
return success(array('list'=>[]));
|
||||
}
|
||||
foreach ($goods_list as $k1 => $v1) {
|
||||
$goods_list[$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$goods_list[$k1]['goods_id'] = Crypt::encrypt($v1['goods_id']);
|
||||
}
|
||||
$page=array(
|
||||
'count'=>$goods_count,
|
||||
'num'=>$page_l,
|
||||
'size'=>$size,
|
||||
'page'=>$totalPages
|
||||
);
|
||||
return success(array('list'=>$goods_list,'page'=>$page));
|
||||
}
|
||||
|
||||
//商品详情
|
||||
public function goods_info(Request $request,Goods $model,MallImage $mimodel,GoodsItem $gimodel,PhaseConfig $pcmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$gid = $param['gid']?Crypt::decrypt($param['gid']):'';
|
||||
if(!$gid){
|
||||
return client_error('暂无数据');
|
||||
}
|
||||
//商品信息
|
||||
$goods_info=$model
|
||||
->alias('g')
|
||||
->field('g.name as goods_name,price,g.id as goods_id,detail,gb.name as brand_name,model,collocation_goods,original_price,goods_size,pc.name as phase_name,goods_category_id')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->join('phase_config pc', 'pc.id= g.phase_id', 'LEFT')
|
||||
->where(array('g.id'=>$gid,'status'=>1))->find();
|
||||
|
||||
//精选配置
|
||||
$collocation_goods=json_decode($goods_info['collocation_goods']);
|
||||
$where[]=array('g.id','in',$collocation_goods);
|
||||
$where[]=array('g.status','=',1);
|
||||
$goods_info['collocation_goods'] =$model
|
||||
->alias('g')
|
||||
->field("mi.thumb_image as img, g.name,g.price,g.id as goods_id,gb.name as brand_name")
|
||||
->join('goods_brand gb', 'gb.id= g.brand_id')
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->where($where)
|
||||
->select();
|
||||
foreach ($goods_info['collocation_goods'] as $k1 => $v1) {
|
||||
$goods_info['collocation_goods'][$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$goods_info['collocation_goods'][$k1]['goods_id'] = Crypt::encrypt($v1['goods_id']);
|
||||
}
|
||||
$goods_info['goods_size']=explode("\r\n",$goods_info['goods_size']);
|
||||
|
||||
$img_list=$mimodel->field('thumb_image,ori_image')->where(array('union_id'=>$gid,'type'=>1))->select();
|
||||
foreach ($img_list as $key => $value) {
|
||||
$img_list[$key]['thumb_image'] =$this->img_url.$value['thumb_image'];
|
||||
$img_list[$key]['ori_image'] =$this->img_url.$value['ori_image'];
|
||||
}
|
||||
//尺寸图片
|
||||
$size_img=$this->img_url.ShopConfig::get('website', 'size_img');
|
||||
|
||||
//商品尺码
|
||||
$goodsitem_list=$gimodel->field("id,spec_value,stock")->where(array('goods_id'=>$goods_info['goods_id']))->select();
|
||||
foreach ($goodsitem_list as $key => $value) {
|
||||
$goodsitem_list[$key]['id']=Crypt::encrypt($value['id']);
|
||||
}
|
||||
|
||||
//品相列表
|
||||
$phaseconfig_list=$pcmodel->field("name,describe")->all();
|
||||
$goods_info['goods_id'] = Crypt::encrypt($goods_info['goods_id']);
|
||||
|
||||
$category_goods =$model
|
||||
->alias('g')
|
||||
->field("mi.thumb_image as img, g.name,g.price,g.id as goods_id,gb.name as brand_name")
|
||||
->join('goods_brand gb', 'gb.id= g.brand_id')
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->where(array('g.goods_category_id'=>$goods_info['goods_category_id'],'g.status'=>1))
|
||||
->select();
|
||||
foreach ($category_goods as $k1 => $v1) {
|
||||
$category_goods[$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$category_goods[$k1]['goods_id'] = Crypt::encrypt($v1['goods_id']);
|
||||
}
|
||||
return success(array('info'=>$goods_info,'img_list'=>$img_list,'size_img'=>$size_img,'goodsitem_list'=>$goodsitem_list,'phaseconfig_list'=>$phaseconfig_list,'category_goods'=>$category_goods));
|
||||
}
|
||||
|
||||
//商品筛选
|
||||
public function category_list(Request $request,GoodsCategory $gcmodel,GoodsBrand $gbmodel)
|
||||
{
|
||||
$brand_list=$gbmodel->field('name,initial')->where(array('is_show'=>1))->select();
|
||||
$category_list=$gcmodel->field('name,id as cid,parent_id')->select();
|
||||
$category=getSubs($category_list,0);
|
||||
$size_list=ShopConfig::get('website', 'size');
|
||||
$size_list=explode(',',$size_list);
|
||||
$data=array(
|
||||
'brand_list'=>$brand_list,
|
||||
'category_list'=>$category,
|
||||
'size_list'=>$size_list,
|
||||
);
|
||||
return success($data);
|
||||
}
|
||||
|
||||
|
||||
//愿望清单列表
|
||||
public function collectgoods_list(Request $request,GoodsCollect $gcmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$size=$param['size']>0?$param['size']:12;
|
||||
$page_l=$param['page']>1?$param['page']:1;
|
||||
$page=$size * ($page_l - 1);
|
||||
$where[]=array('g.status','=',1);
|
||||
$where[]=array('user_id','=',$user_id);
|
||||
|
||||
$goods_count = $gcmodel
|
||||
->alias('gc')
|
||||
->where($where)
|
||||
->join('goods g', 'g.id = gc.goods_id')
|
||||
->join('mall_image mi', 'mi.union_id= gc.goods_id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->count();
|
||||
$totalPages = ceil($goods_count / $size);
|
||||
$goods_list = $gcmodel
|
||||
->alias('gc')
|
||||
->field("mi.thumb_image as img, g.name,g.price,g.id as goods_id,gb.name as brand_name")
|
||||
->join('goods g', 'g.id = gc.goods_id')
|
||||
->join('mall_image mi', 'mi.union_id= gc.goods_id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->where($where)
|
||||
->limit($page, $size)
|
||||
->order('g.sort_number asc')
|
||||
->select();
|
||||
if (!$goods_list) {
|
||||
return success(array('list'=>[]));
|
||||
}
|
||||
foreach ($goods_list as $k1 => $v1) {
|
||||
$goods_list[$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$goods_list[$k1]['goods_id'] = Crypt::encrypt($v1['goods_id']);
|
||||
}
|
||||
$page=array(
|
||||
'count'=>$goods_count,
|
||||
'num'=>$page_l,
|
||||
'size'=>$size,
|
||||
'page'=>$totalPages
|
||||
);
|
||||
return success(array('list'=>$goods_list,'page'=>$page));
|
||||
}
|
||||
|
||||
public function handlecollectgoods(Request $request,GoodsCollect $gcmodel){
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$goods_id = $param['goods_id']?Crypt::decrypt($param['goods_id']):'';
|
||||
if(!$goods_id){
|
||||
return client_error('该商品不存在');
|
||||
}
|
||||
if($param['is_collect']==1){
|
||||
$where = [
|
||||
'user_id' => $user_id,
|
||||
'goods_id' => $goods_id
|
||||
];
|
||||
$info = GoodsCollect::where($where)->find();
|
||||
if(!$info){
|
||||
$data =[
|
||||
'user_id'=>$user_id,
|
||||
'goods_id'=>$goods_id,
|
||||
'create_time'=>time(),
|
||||
];
|
||||
$res =$gcmodel->insert($data);
|
||||
}else{
|
||||
return success('','操作成功');
|
||||
}
|
||||
}else{
|
||||
$res =$gcmodel->where(['goods_id'=>$goods_id,'user_id'=>$user_id])->delete();
|
||||
}
|
||||
return $res ? success('','操作成功') : client_error('操作失败');
|
||||
}
|
||||
}
|
||||
|
|
@ -19,11 +19,13 @@ class IndexController extends Controller
|
|||
{
|
||||
|
||||
protected $authExcept = [
|
||||
'home','pattern_goods','goods_info','goods_list','category_list'
|
||||
'home','pattern_goods'
|
||||
];
|
||||
|
||||
public function home(Request $request,Goods $gmodel,Goodsindex $gimodel)
|
||||
{
|
||||
echo Crypt::encrypt(1).'|';
|
||||
echo $this->getToken(1);
|
||||
$param = $request->param();
|
||||
//首页轮播
|
||||
$carousel = get_ad('carousel',6);
|
||||
|
|
@ -108,133 +110,5 @@ class IndexController extends Controller
|
|||
'page'=>$totalPages
|
||||
);
|
||||
return success(array('list'=>$goods_list,'page'=>$page));
|
||||
}
|
||||
|
||||
//商品列表
|
||||
public function goods_list(Request $request,Goods $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$size=$param['size']>0?$param['size']:12;
|
||||
$page_l=$param['page']>1?$param['page']:1;
|
||||
$page=$size * ($page_l - 1);
|
||||
$where[]=array('status','=',1);
|
||||
$where[]=array('gi.stock','>',0);
|
||||
$keyword = $param['keyword']??'';
|
||||
$where1='';
|
||||
if($keyword){
|
||||
foreach ($keyword as $v1) {
|
||||
$where1.="( `spec_value` LIKE '%".$v1."%' OR `gb`.`name` LIKE '%".$v1."%' OR `gc`.`name` LIKE '%".$v1."%') or";
|
||||
}
|
||||
$where1=rtrim($where1,'or');
|
||||
}
|
||||
$sort=$param['sort']??'asc';
|
||||
$order=$param['order']??'g.sort_number';
|
||||
$goods_count = $model
|
||||
->alias('g')
|
||||
->where($where)
|
||||
->where($where1)
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->join('goods_item gi', 'gi.goods_id = g.id')
|
||||
->join('goods_category gc', 'gc.id = g.goods_category_id')
|
||||
->group('g.id')
|
||||
->count();
|
||||
$totalPages = ceil($goods_count / $size);
|
||||
$goods_list = $model
|
||||
->alias('g')
|
||||
->field("mi.thumb_image as img, g.name,g.price,g.id as goods_id,gb.name as brand_name")
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->join('goods_item gi', 'gi.goods_id = g.id')
|
||||
->join('goods_category gc', 'gc.id = g.goods_category_id')
|
||||
->where($where)
|
||||
->where($where1)
|
||||
->limit($page, $size)
|
||||
->group('g.id')
|
||||
->order($order.' '.$sort)
|
||||
->select();
|
||||
if (!$goods_list) {
|
||||
return success(array('list'=>[]));
|
||||
}
|
||||
foreach ($goods_list as $k1 => $v1) {
|
||||
$goods_list[$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$goods_list[$k1]['goods_id'] = Crypt::encrypt($v1['goods_id']);
|
||||
}
|
||||
$page=array(
|
||||
'count'=>$goods_count,
|
||||
'num'=>$page_l,
|
||||
'size'=>$size,
|
||||
'page'=>$totalPages
|
||||
);
|
||||
return success(array('list'=>$goods_list,'page'=>$page));
|
||||
}
|
||||
|
||||
//商品详情
|
||||
public function goods_info(Request $request,Goods $model,MallImage $mimodel,GoodsItem $gimodel,PhaseConfig $pcmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$gid = $param['gid']?Crypt::decrypt($param['gid']):'';
|
||||
if(!$gid){
|
||||
return client_error('暂无数据');
|
||||
}
|
||||
//商品信息
|
||||
$goods_info=$model
|
||||
->alias('g')
|
||||
->field('g.name as goods_name,price,g.id as goods_id,detail,gb.name as brand_name,model,collocation_goods,original_price,goods_size,pc.name as phase_name')
|
||||
->join('goods_brand gb', 'gb.id = g.brand_id')
|
||||
->join('phase_config pc', 'pc.id= g.phase_id', 'LEFT')
|
||||
->where(array('g.id'=>$gid,'status'=>1))->find();
|
||||
|
||||
//精选配置
|
||||
$collocation_goods=json_decode($goods_info['collocation_goods']);
|
||||
$where[]=array('g.id','in',$collocation_goods);
|
||||
$goods_info['collocation_goods'] =$model
|
||||
->alias('g')
|
||||
->field("mi.thumb_image as img, g.name,g.price,g.id as goods_id,gb.name as brand_name")
|
||||
->join('goods_brand gb', 'gb.id= g.brand_id')
|
||||
->join('mall_image mi', 'mi.union_id= g.id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->where($where)
|
||||
->select();
|
||||
foreach ($goods_info['collocation_goods'] as $k1 => $v1) {
|
||||
$goods_info['collocation_goods'][$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$goods_info['collocation_goods'][$k1]['goods_id'] = Crypt::encrypt($v1['goods_id']);
|
||||
}
|
||||
$goods_info['goods_size']=explode("\r\n",$goods_info['goods_size']);
|
||||
|
||||
$img_list=$mimodel->field('thumb_image,ori_image')->where(array('union_id'=>$gid,'type'=>1))->select();
|
||||
foreach ($img_list as $key => $value) {
|
||||
$img_list[$key]['thumb_image'] =$this->img_url.$value['thumb_image'];
|
||||
$img_list[$key]['ori_image'] =$this->img_url.$value['ori_image'];
|
||||
}
|
||||
//尺寸图片
|
||||
$size_img=$this->img_url.ShopConfig::get('website', 'size_img');
|
||||
|
||||
//商品尺码
|
||||
$goodsitem_list=$gimodel->field("id,spec_value,stock")->where(array('goods_id'=>$goods_info['goods_id']))->select();
|
||||
foreach ($goodsitem_list as $key => $value) {
|
||||
$goodsitem_list[$key]['id']=Crypt::encrypt($value['id']);
|
||||
}
|
||||
|
||||
//品相列表
|
||||
$phaseconfig_list=$pcmodel->field("name,describe")->all();
|
||||
$goods_info['goods_id'] = Crypt::encrypt($goods_info['goods_id']);
|
||||
return success(array('info'=>$goods_info,'img_list'=>$img_list,'size_img'=>$size_img,'goodsitem_list'=>$goodsitem_list,'phaseconfig_list'=>$phaseconfig_list));
|
||||
}
|
||||
|
||||
//商品筛选
|
||||
public function category_list(Request $request,GoodsCategory $gcmodel,GoodsBrand $gbmodel)
|
||||
{
|
||||
$brand_list=$gbmodel->field('name,initial')->where(array('is_show'=>1))->select();
|
||||
$category_list=$gcmodel->field('name,id as cid,parent_id')->select();
|
||||
$category=getSubs($category_list,0);
|
||||
$size_list=ShopConfig::get('website', 'size');
|
||||
$size_list=explode(',',$size_list);
|
||||
$data=array(
|
||||
'brand_list'=>$brand_list,
|
||||
'category_list'=>$category,
|
||||
'size_list'=>$size_list,
|
||||
);
|
||||
return success($data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\model\Order;
|
||||
use app\common\model\ShopConfig;
|
||||
use Exception;
|
||||
use think\Request;
|
||||
use think\response\Json;
|
||||
use tools\Crypt;
|
||||
use tools\WxxiaopayApi;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
//下单接口
|
||||
public function buy(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$action = $param['action'];
|
||||
$info = Order::info($param, $user_id);
|
||||
if (!$info) {
|
||||
return client_error('商品信息不存在');
|
||||
}
|
||||
if($info['code'] == 0) {
|
||||
return client_error($info['msg']);
|
||||
}
|
||||
if ($action == 'info') {
|
||||
return success($info['data']);
|
||||
}
|
||||
$order = Order::add($user_id, $info['data'], $param);
|
||||
if($order['code']==0){
|
||||
return client_error($order['msg']);
|
||||
}
|
||||
return success($order['data']['order_sn'],'下单成功,正在调取支付');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\model\User;
|
||||
use app\common\model\Order;
|
||||
use app\common\model\ShopConfig;
|
||||
use Exception;
|
||||
use think\Request;
|
||||
use think\response\Json;
|
||||
use tools\Crypt;
|
||||
use tools\WxxiaopayApi;
|
||||
use think\facade\Log;
|
||||
|
||||
class PaymentController extends Controller
|
||||
{
|
||||
protected $authExcept = [
|
||||
'wxnotify'
|
||||
];
|
||||
|
||||
/**
|
||||
* Notes: 预支付
|
||||
*/
|
||||
public function prepay(Request $request,Order $omodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$order_sn=$param['order_sn']??'';
|
||||
if(!isset($order_sn)) {
|
||||
return client_error('订单不存在');
|
||||
}
|
||||
$order = $omodel
|
||||
->alias('o')
|
||||
->field("order_status,openid")
|
||||
->join('user u', 'u.id = o.user_id')
|
||||
->where(array('order_sn'=>$order_sn,'user_id'=>$user_id))
|
||||
->find();
|
||||
//找不到订单
|
||||
if (empty($order)) {
|
||||
return client_error('订单不存在');
|
||||
}
|
||||
if ($order['order_status'] !='0') {
|
||||
return client_error('该订单无法进行支付,请查看订单状态');
|
||||
}
|
||||
$order_wechatsn =$order_sn.str_pad(mt_rand(1, 999), 3, '0', STR_PAD_LEFT);
|
||||
$WXPAYKEY=ShopConfig::get('website', 'WXPAYKEY');
|
||||
$MCHID=ShopConfig::get('website', 'MCHID');
|
||||
$APPID=ShopConfig::get('website', 'APPID');
|
||||
$notify_url=ShopConfig::get('website', 'notify_url');
|
||||
$WxxiaopayApi = new WxxiaopayApi($APPID,$MCHID,$WXPAYKEY,$notify_url);
|
||||
$log_ip=$request->ip();
|
||||
$wxData =$WxxiaopayApi->prePay($order_sn,$order_wechatsn,$order_sn,$order['openid'],$log_ip);
|
||||
return success($wxData);
|
||||
}
|
||||
|
||||
//微信小程序回调
|
||||
public function wxnotify(Request $request,FrontMemberLog $fmlmodel,FrontUserMember $fummodel)
|
||||
{
|
||||
$xml = file_get_contents('php://input', 'r');
|
||||
$data = $this->toArray($xml);
|
||||
Log::write('微信回调2:'.var_export($data, true));
|
||||
if($data['result_code']==='SUCCESS' && $data['return_code']==='SUCCESS'){
|
||||
$order_sn = mb_substr($data['out_trade_no'],0,18);
|
||||
$parameter['transaction_id']= $data['transaction_id']; //支付宝交易号
|
||||
$parameter['pay_time'] =time();
|
||||
$parameter['is_pay'] =1;
|
||||
$order_info = $fmlmodel
|
||||
->alias('fml')
|
||||
->field('fml.*,fm.days as days')
|
||||
->where(array('order_sn'=>$order_sn))
|
||||
->join('front_member fm', 'fm.id = fml.member_id')
|
||||
->find();
|
||||
if($order_info){
|
||||
$fummodel_info=$fummodel->where(array('user_id'=>$order_info['user_id'],'cid'=>$order_info['cid']))->find();
|
||||
$days_num=(60*60*24)*$order_info['days'];
|
||||
$data_info['end_time']=time()+$days_num;
|
||||
if($fummodel_info){
|
||||
$fummodel->where(array('id'=>$fummodel_info['id']))->update($data_info);
|
||||
}else{
|
||||
$data_info['user_id']=$order_info['user_id'];
|
||||
$data_info['cid']=$order_info['cid'];
|
||||
$fummodel::create($data_info);
|
||||
}
|
||||
$fmlmodel->where(array('order_sn'=>$order_sn))->update($parameter);
|
||||
exit('success');
|
||||
}
|
||||
}
|
||||
exit('fail');
|
||||
}
|
||||
|
||||
/**
|
||||
* 将xml转为array
|
||||
* @param string $xml xml字符串
|
||||
* @return array 转换得到的数组
|
||||
*/
|
||||
public function toArray($xml) {
|
||||
//禁止引用外部xml实体
|
||||
libxml_disable_entity_loader(true);
|
||||
$result= json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\model\UserAddress;
|
||||
|
||||
use app\common\validate\UserAddressValidate;
|
||||
use think\Request;
|
||||
use tools\Crypt;
|
||||
|
||||
class UserAddressController extends Controller
|
||||
{
|
||||
//获取地址列表
|
||||
public function lists(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$result = UserAddress::infoUserAddress($user_id);
|
||||
return success($result);
|
||||
}
|
||||
|
||||
//设置默认地址
|
||||
public function setDefault(Request $request)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$result = UserAddress::setDefaultAddress($user_id, $param);
|
||||
return $result ? success('','设置成功') : client_error('设置失败');
|
||||
}
|
||||
|
||||
//添加收货地址
|
||||
public function add(Request $request, UserAddressValidate $validate)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$validate_result = $validate->scene('add')->check($param);
|
||||
if (!$validate_result) {
|
||||
return client_error($validate->getError());
|
||||
}
|
||||
$result = UserAddress::addUserAddress($user_id, $param);
|
||||
return $result ? success('','添加成功') : client_error('添加失败');
|
||||
}
|
||||
|
||||
//更新收货地址
|
||||
public function update(Request $request, UserAddressValidate $validate)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$validate_result = $validate->scene('edit')->check($param);
|
||||
if (!$validate_result) {
|
||||
return client_error($validate->getError());
|
||||
}
|
||||
$result = UserAddress::editUserAddress($user_id, $param);
|
||||
return $result ? success('','修改成功') : client_error('修改失败');
|
||||
}
|
||||
|
||||
//删除收货地址
|
||||
public function del(Request $request, UserAddressValidate $validate)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$validate_result = $validate->scene('del')->check($param);
|
||||
if (!$validate_result) {
|
||||
return client_error($validate->getError());
|
||||
}
|
||||
$result = UserAddress::delUserAddress($user_id, $param);
|
||||
return $result ? success('','删除成功') : client_error('删除失败');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,49 +4,102 @@ namespace app\api\controller;
|
|||
|
||||
use app\common\model\User;
|
||||
use app\common\model\Order;
|
||||
use app\common\model\MallImage;
|
||||
use app\common\model\Goods;
|
||||
use app\common\validate\WithdrawAccountValidate;
|
||||
use app\common\model\ShopConfig;
|
||||
use app\common\model\AccountLog;
|
||||
use app\common\model\WithdrawApply;
|
||||
use app\common\model\WithdrawAccount;
|
||||
use app\common\model\Notice;
|
||||
use think\Request;
|
||||
use tools\Crypt;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
|
||||
//我的设备
|
||||
public function equipment(Request $request,Order $model)
|
||||
{
|
||||
//我的消息
|
||||
public function notice(Request $request,Notice $nmodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$uid = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$uid){
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$size=$param['size']>0?$param['size']:12;
|
||||
$page_l=$param['page']>1?$param['page']:1;
|
||||
$page=$size * ($page_l - 1);
|
||||
$order_count = $model
|
||||
->alias('o')
|
||||
->where(array('o.user_id'=>$uid))
|
||||
->join('mall_image mi', 'mi.union_id= o.goods_id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
$where[]=array('user_id','=',$user_id);
|
||||
$where[]=array('send_type','=',1);
|
||||
$where[]=array('receive_type','in','2,3');
|
||||
$notice_count = $nmodel
|
||||
->where($where)
|
||||
->count();
|
||||
$totalPages = ceil($notice_count / $size);
|
||||
$notice_list = $nmodel
|
||||
->field("title,content")
|
||||
->where($where)
|
||||
->limit($page, $size)
|
||||
->order('create_time DESC')
|
||||
->select();
|
||||
if (!$notice_list) {
|
||||
return success(array('list'=>[]));
|
||||
}
|
||||
$page=array(
|
||||
'count'=>$notice_count,
|
||||
'num'=>$page_l,
|
||||
'size'=>$size,
|
||||
'page'=>$totalPages
|
||||
);
|
||||
return success(array('list'=>$notice_list,'page'=>$page));
|
||||
}
|
||||
|
||||
//我的订单
|
||||
public function order(Request $request,Order $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$where[] = ['o.user_id', '=', $user_id];
|
||||
//订单类型
|
||||
if ($param['order_status'] != '') {
|
||||
$where[] = ['o.order_status', 'in', $param['order_status']];
|
||||
}
|
||||
$size=$param['size']>0?$param['size']:12;
|
||||
$page_l=$param['page']>1?$param['page']:1;
|
||||
$page=$size * ($page_l - 1);
|
||||
$order_count = $model
|
||||
->alias('o')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->with(['order_goods'])
|
||||
->where($where)
|
||||
->order('o.id desc')
|
||||
->group('o.id')
|
||||
->count();
|
||||
$totalPages = ceil($order_count / $size);
|
||||
$order_list = $model
|
||||
->alias('o')
|
||||
->field("mi.thumb_image as img, o.goods_name,o.attr,o.order_price,number,o.id as order_id,o.create_time,o.end_time")
|
||||
->where(array('o.user_id'=>$uid))
|
||||
->join('mall_image mi', 'mi.union_id= o.goods_id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->limit($page, $size)
|
||||
->order('o.create_time DESC')
|
||||
->select();
|
||||
->alias('o')
|
||||
->field('o.order_sn,o.order_status,o.id')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->with(['order_goods'])
|
||||
->where($where)
|
||||
->order('o.id desc')
|
||||
->group('o.id')
|
||||
->limit($page, $size)
|
||||
->select();
|
||||
if (!$order_list) {
|
||||
return client_error('暂无数据');
|
||||
return success(array('list'=>[]));
|
||||
}
|
||||
foreach ($order_list as $k1 => $v1) {
|
||||
$order_list[$k1]['img'] =$this->img_url.$v1['img'];
|
||||
$order_list[$k1]['order_id'] = Crypt::encrypt($v1['order_id']);
|
||||
$order_list[$k1]['order_id'] = Crypt::encrypt($v1['id']);
|
||||
$order_list[$k1]['order_status_text'] = $v1['order_status_text'];
|
||||
unset($v1['id']);
|
||||
foreach ($v1['order_goods'] as &$order_goods){
|
||||
$order_goods['goods_img']=$this->img_url.$order_goods['goods_img'];
|
||||
$order_goods['goods_id'] = Crypt::encrypt($order_goods['goods_id']);
|
||||
unset($order_goods['id'],$order_goods['order_id']);
|
||||
}
|
||||
}
|
||||
$page=array(
|
||||
'count'=>$order_count,
|
||||
|
|
@ -57,6 +110,85 @@ class UserController extends Controller
|
|||
return success(array('list'=>$order_list,'page'=>$page));
|
||||
}
|
||||
|
||||
//我的订单详情
|
||||
public function orderdetail(Request $request,Order $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$order_id = $param['order_id']?Crypt::decrypt($param['order_id']):'';
|
||||
if(!$order_id){
|
||||
return client_error('该订单不存在');
|
||||
}
|
||||
$where[] = ['o.user_id', '=', $user_id];
|
||||
$where[] = ['o.id', '=', $order_id];
|
||||
$order_info = $model
|
||||
->alias('o')
|
||||
->field('o.order_sn,o.order_status,o.id,o.pay_time,total_amount,shipping_time,invoice_name,invoice_no,transaction_id,user_remark,confirm_take_time,cancel_time,o.create_time,province,city,district,address,mobile,consignee')
|
||||
->join('order_goods g', 'g.order_id = o.id')
|
||||
->with(['order_goods'])
|
||||
->append(['delivery_address'])
|
||||
->where($where)
|
||||
->find();
|
||||
if (!$order_info) {
|
||||
return client_error('该订单不存在');
|
||||
}
|
||||
$order_info['order_id'] = Crypt::encrypt($order_info['id']);
|
||||
$order_info['order_status_text'] = $order_info['order_status_text'];
|
||||
foreach ($order_info['order_goods'] as &$order_goods){
|
||||
$order_goods['goods_img']=$this->img_url.$order_goods['goods_img'];
|
||||
$order_goods['goods_id'] = Crypt::encrypt($order_goods['goods_id']);
|
||||
unset($order_goods['id'],$order_goods['order_id']);
|
||||
}
|
||||
unset($order_info['id']);
|
||||
return success($order_info);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 取消订单
|
||||
* @param $order_id
|
||||
* @param $user_id
|
||||
*/
|
||||
public static function ordercancel(Request $request,Order $model)
|
||||
{
|
||||
$param = $request->param();
|
||||
$user_id = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$user_id){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$order_id = $param['order_id']?Crypt::decrypt($param['order_id']):'';
|
||||
if(!$order_id){
|
||||
return client_error('该订单不存在');
|
||||
}
|
||||
$order = Order::get([
|
||||
'user_id' => $user_id,
|
||||
'id' => $order_id
|
||||
]);
|
||||
if (!$order || $order['order_status']!='0') {
|
||||
return client_error('很抱歉!订单无法取消');
|
||||
}
|
||||
|
||||
$model->startTrans();
|
||||
try {
|
||||
//取消订单
|
||||
$update = [
|
||||
'cancel_time' => time(),
|
||||
'order_status' => 4,
|
||||
];
|
||||
$model->where(['id' => $order_id])->update($update);
|
||||
$model->commit();
|
||||
} catch (Exception $e) {
|
||||
$model->rollback();
|
||||
return client_error($e->getMessage());
|
||||
}
|
||||
return success('','取消成功');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//收益统计
|
||||
public function profit_census(Request $request,AccountLog $almodel,WithdrawApply $wamodel,User $umodel)
|
||||
{
|
||||
|
|
@ -404,64 +536,4 @@ class UserController extends Controller
|
|||
}
|
||||
return success('','提交提现申请成功,等待审核打款');
|
||||
}
|
||||
|
||||
//领取体验设备
|
||||
public function experience(Request $request,Order $omodel,User $umodel)
|
||||
{
|
||||
$param = $request->param();
|
||||
$uid = $param['uid']?Crypt::decrypt($param['uid']):'';
|
||||
if(!$uid){
|
||||
return unauthorized('请先授权');
|
||||
}
|
||||
$goods_id=ShopConfig::get('goods', 'goods_id');
|
||||
if(!$goods_id){
|
||||
return client_error('体验设备信息不存在');
|
||||
}
|
||||
$is_open=ShopConfig::get('goods', 'is_open');
|
||||
if($is_open==0){
|
||||
return client_error('体验设备已关闭,无法领取');
|
||||
}
|
||||
$ty_count=$omodel->where(array('order_type'=>2,'goods_id'=>$goods_id))->count();
|
||||
if($ty_count>0){
|
||||
return client_error('您已领取该体验设备,无法重复领取');
|
||||
}
|
||||
$is_first=ShopConfig::get('goods', 'is_first');
|
||||
if($is_first==1){
|
||||
$user_count=$umodel->where(array('user_level_id'=>1))->count();
|
||||
if($user_count==0){
|
||||
return client_error('您不是新用户,无法领取');
|
||||
}
|
||||
}
|
||||
$day=ShopConfig::get('goods', 'day');
|
||||
|
||||
$field_data = array();
|
||||
$goods_info=Goods::where(array('id'=>$goods_id))->find()->toArray();
|
||||
$field_data[] = [
|
||||
'order_no'=>get_order_sn(),
|
||||
'goods_id' => $goods_id,
|
||||
'number' => 1,
|
||||
'end_time' => time()+$day*60*60*24,
|
||||
'user_id' => $uid,
|
||||
'goods_name' => $goods_info['name'],
|
||||
'attr' => $goods_info['attr'],
|
||||
'order_price' =>'0.00',
|
||||
'create_time'=>time(),
|
||||
'order_type'=>2,
|
||||
];
|
||||
if(count($field_data)==0){
|
||||
return client_error('体验设备信息不存在');
|
||||
}
|
||||
// 启动事务
|
||||
$omodel->startTrans();
|
||||
try{
|
||||
$omodel->insertAll($field_data);
|
||||
// 提交事务
|
||||
$omodel->commit();
|
||||
}catch(\Exception $e){
|
||||
// 回滚事务
|
||||
$omodel->rollback();
|
||||
return client_error($e->getMessage());
|
||||
}
|
||||
return success('','领取成功');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,10 +99,6 @@ if (!function_exists('get_order_sn')) {
|
|||
* @param string $prefix
|
||||
* @param int $rand_suffix_length
|
||||
* @param array $pool
|
||||
* @return string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
function createSn($table, $field, $prefix = '', $rand_suffix_length = 4, $pool = [])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,16 +2,22 @@
|
|||
/**
|
||||
* 购物车模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use think\Db;
|
||||
class Cart extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'cart';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
//检查库存
|
||||
public static function checkStock($item_value, $goods_num,$goods_id)
|
||||
{
|
||||
$item_info = Db::name('goods_item')
|
||||
->where(array('goods_id'=>$goods_id,'spec_value'=>$item_value))->find();
|
||||
if ($goods_num > $item_info['stock']) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
/**
|
||||
* 商品品牌模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class GoodsCollect extends Model
|
||||
{
|
||||
protected $name = 'goods_collect';
|
||||
protected $autoWriteTimestamp = true;
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ class Model extends \think\Model
|
|||
//用户等级
|
||||
const LEVL_TEXT = [1 => '普通会员'];
|
||||
//订单状态
|
||||
const ORDER_TEXT = [0 => '待付款', 1=> '待发货',2=> '待收货',3=> '已完成'];
|
||||
const ORDER_TEXT = [0 => '待付款', 1=> '待发货',2=> '待收货',3=> '已完成',4=> '已取消'];
|
||||
//寄卖状态
|
||||
const JMORDER_TEXT = [0 => '审核中', 1=> '待上架',2=> '已上架',3=> '待客户确认',4=> '客户已确认',5=> '已取货',6=> '部分退回','7'=>'全部退回'];
|
||||
//寄卖商品信息
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ use think\db;
|
|||
use tools\Crypt;
|
||||
class Notice extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'notice';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,24 @@ class Order extends Model
|
|||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//付款时间获取器
|
||||
public function getPayTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//确认收货时间获取器
|
||||
public function getConfirmTakeTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//取消时间获取器
|
||||
public function getCancelTimeAttr($value)
|
||||
{
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
|
||||
//订单状态
|
||||
public function getOrderStatusTextAttr($value, $data)
|
||||
{
|
||||
|
|
@ -32,7 +50,7 @@ class Order extends Model
|
|||
//订单关联商品
|
||||
public function orderGoods()
|
||||
{
|
||||
return $this->hasMany(OrderGoods::class, 'order_id', 'id');
|
||||
return $this->hasMany(OrderGoods::class, 'order_id', 'id')->field('goods_id,item_value,goods_name,goods_img,brand_name,goods_num,goods_price,total_price,order_id,id');
|
||||
}
|
||||
|
||||
//订单用户
|
||||
|
|
@ -83,4 +101,239 @@ class Order extends Model
|
|||
];
|
||||
Notice::noticeByScene($order['user_id'],$data_info);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 结算详情
|
||||
* @param $post
|
||||
* @param $user_id
|
||||
* @return array
|
||||
*/
|
||||
public static function info($post, $user_id)
|
||||
{
|
||||
try{
|
||||
$goods =Db::name('cart')
|
||||
->alias('c')
|
||||
->field("mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,c.goods_num,item_value,g.status,g.stock,g.original_price")
|
||||
->join('goods g', 'g.id = c.goods_id')
|
||||
->join('goods_brand gb', 'gb.id= g.brand_id')
|
||||
->join('mall_image mi', 'mi.union_id= c.goods_id and is_cover=1 and mi.type=1', 'LEFT')
|
||||
->where(array('c.user_id'=>$user_id,'selected'=>1))
|
||||
->select();
|
||||
$goods_lists = array();
|
||||
$total_num = 0;//商品总数量
|
||||
$total_goods_price = 0;//商品总金额
|
||||
foreach ($goods as $good) {
|
||||
$good['sub_price'] = round($good['goods_price'] * $good['goods_num'], 2);
|
||||
$goods_lists[] = $good;
|
||||
//订单汇总信息
|
||||
$total_num += $good['goods_num'];
|
||||
$total_goods_price += $good['goods_price'] * $good['goods_num'];
|
||||
}
|
||||
if (empty($goods_lists)) {
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>'购物车无商品',
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
//用户地址
|
||||
$user_address = UserAddress::getOrderUserAddress($post, $user_id);
|
||||
|
||||
//订单金额
|
||||
$total_amount = $total_goods_price;
|
||||
//订单应付金额
|
||||
$order_amount = $total_goods_price;
|
||||
|
||||
|
||||
if ($order_amount <= 0){
|
||||
$order_amount = 0;
|
||||
}
|
||||
$result = [
|
||||
'goods_lists' => array_values($goods_lists),
|
||||
'total_num' => $total_num,//订单总数量
|
||||
'total_goods_price' => round($total_goods_price, 2),//订单商品总价
|
||||
'total_amount' => round($total_amount, 2),//订单总价(商品价格,运费,优惠券等)
|
||||
'order_amount' => round($order_amount, 2),//订单应付价格
|
||||
'address' => $user_address,
|
||||
'remark' => $post['remark'] ?? '',
|
||||
];
|
||||
$data=[
|
||||
'code' =>1,
|
||||
'msg' =>'',
|
||||
'data' =>$result,
|
||||
];
|
||||
return $data;
|
||||
} catch (Exception $e) {
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>$e->getMessage(),
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 添加订单
|
||||
* @param $user_id
|
||||
* @param $data
|
||||
* @param $post
|
||||
*/
|
||||
public static function add($user_id, $data, $post)
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$goods_lists = $data['goods_lists'];
|
||||
if (empty($data['goods_lists'])) {
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>'购物车无商品',
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
$user_address = $data['address'];
|
||||
$user = User::get($user_id);
|
||||
if (empty($data['address'])) {
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>'请选择收货地址',
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
$order = self::addOrder($user_id, $data, $user_address);
|
||||
$order_id = $order['order_id'];
|
||||
$addOrderGoods=self::addOrderGoods($order_id, $goods_lists);
|
||||
if($addOrderGoods['code']==0){
|
||||
return $addOrderGoods;
|
||||
}
|
||||
self::addOrderAfter($order_id, $user_id, $data);
|
||||
|
||||
Db::commit();
|
||||
$data=[
|
||||
'code' =>1,
|
||||
'msg' =>'',
|
||||
'data' =>$order,
|
||||
];
|
||||
return $data;
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>$e->getMessage(),
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 添加订单记录
|
||||
* @param $user_id
|
||||
* @param $data
|
||||
* @param $user_address
|
||||
* @param array $extra
|
||||
*/
|
||||
public static function addOrder($user_id, $data, $user_address)
|
||||
{
|
||||
|
||||
$order_data = [
|
||||
'order_sn' => createSn('order', 'order_sn', '', 4),
|
||||
'user_id' => $user_id,
|
||||
'consignee' => $user_address['contact'],
|
||||
'province' => $user_address['province_id'],
|
||||
'city' => $user_address['city_id'],
|
||||
'district' => $user_address['district_id'],
|
||||
'address' => $user_address['address'],
|
||||
'mobile' => $user_address['telephone'],
|
||||
'total_goods_price' => $data['total_goods_price'],
|
||||
'order_amount' => $data['order_amount'],//应付金额
|
||||
'total_amount' => $data['total_amount'],//订单总金额
|
||||
'total_num' => $data['total_num'],//订单商品数量
|
||||
'user_remark' => $data['remark'],
|
||||
'create_time' => time(),
|
||||
];
|
||||
$order_id = Db::name('order')->insertGetId($order_data);
|
||||
return [
|
||||
'order_id' => $order_id,
|
||||
'order_sn' => $order_data['order_sn'],
|
||||
'order_amount' => $order_data['order_amount'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 添加订单商品记录
|
||||
* @param $order_id
|
||||
* @param $goods_lists
|
||||
*/
|
||||
public static function addOrderGoods($order_id, $goods_lists)
|
||||
{
|
||||
foreach ($goods_lists as $k1 => $good) {
|
||||
//商品验证
|
||||
if ($good['status'] != 1) {
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>'包含不存在或已下架的商品,无法下单',
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
if ($good['goods_num'] > $good['stock']) {
|
||||
$data=[
|
||||
'code' =>0,
|
||||
'msg' =>'商品库存不足,无法下单',
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
$goods_data[] = [
|
||||
'order_id' => $order_id,
|
||||
'goods_id' => $good['goods_id'],
|
||||
'goods_img' => $good['goods_img'],
|
||||
'item_value' => $good['item_value'],
|
||||
'brand_name' => $good['brand_name'],
|
||||
'goods_name' => $good['goods_name'],
|
||||
'goods_num' => $good['goods_num'],
|
||||
'goods_price' => $good['goods_price'],//商品价格单价(未扣减优惠和积分价格)
|
||||
'total_price' => $good['goods_price'] * $good['goods_num'],
|
||||
'original_price' => $good['original_price'] ?? 0,//商品原始价格
|
||||
'create_time' => time(),
|
||||
];
|
||||
}
|
||||
Db::name('order_goods')->insertAll($goods_data);
|
||||
$data=[
|
||||
'code' =>1,
|
||||
'msg' =>'',
|
||||
'data' =>'',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notes: 下单后操作
|
||||
* @param $order_id
|
||||
* @param $user_id
|
||||
* @param $type
|
||||
* @param $data
|
||||
*/
|
||||
public static function addOrderAfter($order_id, $user_id, $data)
|
||||
{
|
||||
$goods_data = $data['goods_lists'];
|
||||
|
||||
//下单时扣减商品库存
|
||||
OrderGoods::decStock($goods_data);
|
||||
|
||||
//删除购物车商品
|
||||
$cart_items = array_column($goods_data, 'item_value');
|
||||
Db::name('cart')->where([
|
||||
['user_id', '=', $user_id],
|
||||
['selected', '=', 1],
|
||||
['item_value', 'in', $cart_items],
|
||||
])->delete();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,66 @@
|
|||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
use think\db;
|
||||
class OrderGoods extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'order_goods';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
|
||||
//下单扣除订单库存
|
||||
public static function decStock($goods)
|
||||
{
|
||||
$goods_ids = [];
|
||||
foreach ($goods as $k1 => $good) {
|
||||
$item_value = $good['item_value'];
|
||||
//扣除库存,扣除规格库存,增加商品销量
|
||||
Db::name('goods')
|
||||
->where('id', $good['goods_id'])
|
||||
->update([
|
||||
'order_num' => Db::raw("order_num+" . $good['goods_num']),
|
||||
'stock' => Db::raw('stock-' . $good['goods_num'])
|
||||
]);
|
||||
//扣除规格表库存
|
||||
Db::name('goods_item')
|
||||
->where(array('goods_id'=>$good['goods_id'],'spec_value'=>$good['item_value']))
|
||||
->setDec('stock', $good['goods_num']);
|
||||
$goods_ids[] = $good['goods_id'];
|
||||
}
|
||||
//下架商品总库存为0的商品
|
||||
if (!empty($goods_ids)){
|
||||
self::outGoods($goods_ids);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes: 下单后下架商品总库存为0的商品
|
||||
* @param $goods_id
|
||||
*/
|
||||
public static function outGoods($goods_ids)
|
||||
{
|
||||
try{
|
||||
$goods = Db::name('goods')
|
||||
->field('id, stock')
|
||||
->where('id', 'in', $goods_ids)
|
||||
->select();
|
||||
if (empty($goods)){
|
||||
return true;
|
||||
}
|
||||
$need_handle_ids = [];
|
||||
foreach ($goods as $good) {
|
||||
if ($good['stock'] <= 0) {
|
||||
$need_handle_ids[] = $good['id'];
|
||||
}
|
||||
}
|
||||
if (empty($need_handle_ids)){
|
||||
return true;
|
||||
}
|
||||
//下架订单商品中 商品总库存已为0的商品
|
||||
Db::name('goods')->where('id', 'in', $need_handle_ids)->update(['status' => 0]);
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,221 @@
|
|||
<?php
|
||||
/**
|
||||
* 用户地址模型
|
||||
*/
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\model\concern\SoftDelete;
|
||||
use think\db;
|
||||
class UserAddress extends Model
|
||||
{
|
||||
use SoftDelete;
|
||||
public $softDelete = true;
|
||||
protected $name = 'user_address';
|
||||
protected $autoWriteTimestamp = true;
|
||||
|
||||
/**
|
||||
* 获取用户地址信息
|
||||
* @param $user_id
|
||||
*/
|
||||
public static function infoUserAddress($user_id){
|
||||
$info = Db::name('user_address')
|
||||
->where(['user_id'=>$user_id])
|
||||
->field('id,contact,telephone,province_id,city_id,district_id,address,is_default')
|
||||
->select();
|
||||
foreach ($info as &$item) {
|
||||
$item['province'] = self::getAddress($item['province_id']);
|
||||
$item['city'] = self::getAddress($item['city_id']);
|
||||
$item['district'] = self::getAddress($item['district_id']);
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认地址
|
||||
* @param $user_id
|
||||
*/
|
||||
public static function getDefaultAddress($user_id){
|
||||
$info = Db::name('user_address')
|
||||
->where(['is_default'=>1,'user_id'=>$user_id])
|
||||
->field('id,contact,telephone,province_id,city_id,district_id,address,is_default')
|
||||
->find();
|
||||
if (!$info){
|
||||
return [];
|
||||
}
|
||||
$info['province'] = self::getAddress($info['province_id']);
|
||||
$info['city'] = self::getAddress($info['city_id']);
|
||||
$info['district'] = self::getAddress($info['district_id']);
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认地址
|
||||
* @param $user_id
|
||||
* @param $post
|
||||
* @return int|string
|
||||
*/
|
||||
public static function setDefaultAddress($user_id,$post){
|
||||
Db::startTrans();
|
||||
try {
|
||||
Db::name('user_address')
|
||||
->where(['user_id'=>$user_id])
|
||||
->update(['is_default'=>0]);
|
||||
|
||||
$result = Db::name('user_address')
|
||||
->where(['id'=>$post['id'],'user_id'=>$user_id])
|
||||
->update(['is_default'=>1]);
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加收货地址
|
||||
* @param $user_id
|
||||
* @param $post
|
||||
* @return int|string
|
||||
*/
|
||||
public static function addUserAddress($user_id,$post) {
|
||||
Db::startTrans();
|
||||
try {
|
||||
if ($post['is_default'] == 1){
|
||||
Db::name('user_address')
|
||||
->where(['user_id'=>$user_id])
|
||||
->update(['is_default'=>0]);
|
||||
}else{
|
||||
$is_first = Db::name('user_address')
|
||||
->where(['user_id'=>$user_id])
|
||||
->select();
|
||||
if (empty($is_first)){
|
||||
$post['is_default'] = 1;
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
'contact' => $post['contact'],
|
||||
'telephone' => $post['telephone'],
|
||||
'province_id' => $post['province_id'],
|
||||
'city_id' => $post['city_id'],
|
||||
'district_id' => $post['district_id'],
|
||||
'address' => $post['address'],
|
||||
'is_default' => $post['is_default'],
|
||||
'create_time' => time()
|
||||
];
|
||||
$result = Db::name('user_address')->insert($data);
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑用户地址
|
||||
* @param $user_id
|
||||
* @param $post
|
||||
*/
|
||||
public static function editUserAddress($user_id,$post) {
|
||||
Db::startTrans();
|
||||
try {
|
||||
if ($post['is_default'] == 1){
|
||||
Db::name('user_address')
|
||||
->where(['user_id'=>$user_id])
|
||||
->update(['is_default'=>0]);
|
||||
}
|
||||
$data = [
|
||||
'contact' => $post['contact'],
|
||||
'telephone' => $post['telephone'],
|
||||
'province_id' => $post['province_id'],
|
||||
'city_id' => $post['city_id'],
|
||||
'district_id' => $post['district_id'],
|
||||
'address' => $post['address'],
|
||||
'is_default' => $post['is_default'],
|
||||
'update_time' => time()
|
||||
];
|
||||
$result = Db::name('user_address')
|
||||
->where(['id'=>$post['id'],'user_id'=>$user_id])
|
||||
->update($data);
|
||||
Db::commit();
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
return false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户地址
|
||||
* @param $user_id
|
||||
* @param $post
|
||||
*/
|
||||
public static function delUserAddress($user_id,$post) {
|
||||
return Db::name('user_address')->where(['id'=>$post['id'],'user_id'=>$user_id])->delete();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Desc: 获取用户指定id的地址
|
||||
* @param $address
|
||||
* @param $user_id
|
||||
*/
|
||||
public static function getUserAddressById($address, $user_id)
|
||||
{
|
||||
$info = Db::name('user_address')
|
||||
->where(['id' => $address, 'user_id' => $user_id])
|
||||
->field('id,contact,telephone,province_id,city_id,district_id,address,is_default')
|
||||
->find();
|
||||
|
||||
if (!$info) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$info['province'] = self::getAddress($info['province_id']);
|
||||
$info['city'] = self::getAddress($info['city_id']);
|
||||
$info['district'] = self::getAddress($info['district_id']);
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
//获取订单用户地址
|
||||
|
||||
/**
|
||||
* Desc: 获取下单时用户地址
|
||||
* @param $data
|
||||
* @param $user_id
|
||||
*/
|
||||
public static function getOrderUserAddress($data, $user_id)
|
||||
{
|
||||
if (isset($data['address_id']) && $data['address_id'] != 0){
|
||||
return self::getUserAddressById($data['address_id'], $user_id);
|
||||
}
|
||||
return self::getDefaultAddress($user_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取地址
|
||||
* @param $val(为非数组,返回单独地点名,为数组时,按顺序拼接地址返回)
|
||||
* @param string $address val为数组时,连接详细地址一起返回
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function getAddress($val, $address = '')
|
||||
{
|
||||
$area_id_name = Db::name('dev_region')->column('name', 'id');
|
||||
if (!is_array($val)) {
|
||||
return isset($area_id_name[$val]) ? $area_id_name[$val] : '';
|
||||
}
|
||||
$long_address = '';
|
||||
foreach ($val as $id) {
|
||||
$long_address .= isset($area_id_name[$id]) ? $area_id_name[$id] : '';
|
||||
}
|
||||
return $long_address . $address;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* 用户地址验证器
|
||||
*/
|
||||
|
||||
namespace app\common\validate;
|
||||
|
||||
class UserAddressValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'id|地址id' => 'require',
|
||||
'contact|收货人' => 'require',
|
||||
'telephone|手机号码' => 'require',
|
||||
'province_id|省' => 'require',
|
||||
'city_id|市' => 'require',
|
||||
'district_id|区' => 'require',
|
||||
'address|是否启用' => 'require',
|
||||
'post_code|邮编' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => '该地址不存在',
|
||||
'contact.require' => '收货人不能为空',
|
||||
'telephone.require' => '手机号不能为空',
|
||||
'province_id.require' => '省不能为空',
|
||||
'city_id.require' => '市不能为空',
|
||||
'district_id.require' => '区不能为空',
|
||||
'address.require' => '详情地址不能为空',
|
||||
'post_code.require' => '邮编不能为空',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['contact', 'telephone', 'province_id', 'city_id', 'district_id', 'address',],
|
||||
'edit' => ['contact', 'telephone', 'province_id', 'city_id', 'district_id', 'address',],
|
||||
'del' =>['id'],
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ return [
|
|||
//使用者
|
||||
'aud' => 'aud',
|
||||
//过期时间,以秒为单位,默认2小时
|
||||
'ttl' => 7200,
|
||||
'ttl' => 30*60*60*24,
|
||||
//刷新时间,以秒为单位,默认14天,以
|
||||
'refresh_ttl' => 1209600,
|
||||
//是否自动刷新,开启后可自动刷新token,附在header中返回,name为`Authorization`,字段为`Bearer `+$token
|
||||
|
|
|
|||
|
|
@ -0,0 +1,204 @@
|
|||
<?php
|
||||
namespace tools;
|
||||
|
||||
/**
|
||||
* 微信小程序支付
|
||||
*
|
||||
*/
|
||||
use Org\Util\Date;
|
||||
|
||||
class WxxiaopayApi {
|
||||
|
||||
protected $APPID;
|
||||
protected $MCHID;
|
||||
protected $KEY;
|
||||
protected $notify_url;
|
||||
|
||||
public function __construct($APPID,$MCHID,$KEY,$notify_url)
|
||||
{
|
||||
$this->APPID = $APPID;
|
||||
$this->MCHID = $MCHID;
|
||||
$this->KEY = $KEY;
|
||||
$this->notify_url = $notify_url;
|
||||
}
|
||||
|
||||
/**
|
||||
**$order_sn 原订单号
|
||||
**$order_sn 现订单号
|
||||
**$totalFee 价格
|
||||
**$openid
|
||||
**/
|
||||
//统一下单调用
|
||||
public function prePay($order_sn,$order_by_sn, $totalFee, $openid,$ip){
|
||||
$url = 'https://api.mch.weixin.qq.com/pay/unifiedorder';
|
||||
$nonce_str = self::getRandChar_l(32);
|
||||
$data['appid'] =$this->APPID;
|
||||
$data['mch_id'] = $this->MCHID;
|
||||
$data['nonce_str'] = $nonce_str;
|
||||
$data['body'] = '订单编号:'.$order_sn;
|
||||
$data['out_trade_no'] = $order_by_sn;
|
||||
$data['total_fee'] = $totalFee*100;
|
||||
$data['spbill_create_ip'] =$ip;
|
||||
$data['notify_url'] = $this->notify_url;
|
||||
$data['trade_type'] = 'JSAPI';
|
||||
$data['openid'] = $openid;
|
||||
$data['sign'] = self::sign($data,$this->KEY);
|
||||
$xml = self::arrayToXml($data);
|
||||
$response = self::postXmlCurl($xml, $url);
|
||||
$array=self::xmlstr_to_array($response);
|
||||
$wxData = self::wxPay($array['prepay_id'],$this->APPID,$this->KEY);
|
||||
return $wxData;
|
||||
}
|
||||
|
||||
//微信支付
|
||||
static function wxPay($prepayId,$APPID,$KEY){
|
||||
$data['appId'] = $APPID;
|
||||
$data['nonceStr'] = self::getRandChar_l(32);
|
||||
$data['package'] = "prepay_id=".$prepayId;
|
||||
$data['signType'] = 'MD5';
|
||||
$data['timeStamp'] = time();
|
||||
$data['sign'] = self::getSign($data,$KEY);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///生成签名
|
||||
static function getSign($Obj,$KEY){
|
||||
foreach ($Obj as $k => $v) {
|
||||
$Parameters[strtolower($k)] = $v;
|
||||
}
|
||||
// 签名步骤一:按字典序排序参数
|
||||
ksort($Parameters);
|
||||
$String = "appId=".$Obj['appId']."&nonceStr=".$Obj['nonceStr']."&package=".$Obj['package']."&signType=MD5&timeStamp=".$Obj['timeStamp'];
|
||||
// 签名步骤二:在string后加入KEY
|
||||
$String = $String . "&key=" . $KEY;
|
||||
// 签名步骤三:MD5加密
|
||||
$result_ = strtoupper(md5($String));
|
||||
return $result_;
|
||||
}
|
||||
|
||||
// xml转成数组
|
||||
static function xmlstr_to_array($xmlstr){
|
||||
//禁止引用外部xml实体
|
||||
|
||||
libxml_disable_entity_loader(true);
|
||||
|
||||
$xmlstring = simplexml_load_string($xmlstr, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
|
||||
$val = json_decode(json_encode($xmlstring),true);
|
||||
|
||||
return $val;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 获取指定长度的随机字符串
|
||||
protected function getRandChar($length){
|
||||
$str = null;
|
||||
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
$max = strlen($strPol) - 1;
|
||||
|
||||
for ($i = 0; $i < $length; $i ++) {
|
||||
$str .= $strPol[rand(0, $max)]; // rand($min,$max)生成介于min和max两个数之间的一个随机整数
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
// 将数组转成uri字符串
|
||||
static function formatBizQueryParaMap($paraMap, $urlencode){
|
||||
$buff = "";
|
||||
ksort($paraMap);
|
||||
foreach ($paraMap as $k => $v) {
|
||||
if ($urlencode) {
|
||||
$v = urlencode($v);
|
||||
}
|
||||
$buff .= strtolower($k) . "=" . $v . "&";
|
||||
}
|
||||
$reqPar;
|
||||
if (strlen($buff) > 0) {
|
||||
$reqPar = substr($buff, 0, strlen($buff) - 1);
|
||||
}
|
||||
return $reqPar;
|
||||
}
|
||||
|
||||
// 数组转xml
|
||||
static function arrayToXml($arr){
|
||||
$xml = "<xml>";
|
||||
foreach ($arr as $key => $val) {
|
||||
if (is_numeric($val)) {
|
||||
$xml .= "<" . $key . ">" . $val . "</" . $key . ">";
|
||||
} else
|
||||
$xml .= "<" . $key . "><![CDATA[" . $val . "]]></" . $key . ">";
|
||||
}
|
||||
$xml .= "</xml>";
|
||||
return $xml;
|
||||
}
|
||||
|
||||
// post https请求,CURLOPT_POSTFIELDS xml格式
|
||||
static function postXmlCurl($xml, $url, $second = 30){
|
||||
// 初始化curl
|
||||
$ch = curl_init();
|
||||
// 超时时间
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $second);
|
||||
// 这里设置代理,如果有的话
|
||||
// curl_setopt($ch,CURLOPT_PROXY, '8.8.8.8');
|
||||
// curl_setopt($ch,CURLOPT_PROXYPORT, 8080);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
// 设置header
|
||||
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
||||
// 要求结果为字符串且输出到屏幕上
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
// post提交方式
|
||||
curl_setopt($ch, CURLOPT_POST, TRUE);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
|
||||
// 运行curl
|
||||
$data = curl_exec($ch);
|
||||
|
||||
// 返回结果
|
||||
if ($data) {
|
||||
curl_close($ch);
|
||||
return $data;
|
||||
} else {
|
||||
$error = curl_errno($ch);
|
||||
echo "curl出错,错误码:$error" . "<br>";
|
||||
echo "<a href='http://curl.haxx.se/libcurl/c/libcurl-errors.html'>错误原因查询</a></br>";
|
||||
curl_close($ch);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//生成签名
|
||||
static function sign($Obj,$KEY){
|
||||
foreach ($Obj as $k => $v) {
|
||||
$Parameters[strtolower($k)] = $v;
|
||||
}
|
||||
// 签名步骤一:按字典序排序参数
|
||||
ksort($Parameters);
|
||||
$String = self::formatBizQueryParaMap($Parameters, false);
|
||||
// 签名步骤二:在string后加入KEY
|
||||
$String = $String . "&key=" . $KEY;
|
||||
// 签名步骤三:MD5加密
|
||||
$result_ = strtoupper(md5($String));
|
||||
return $result_;
|
||||
}
|
||||
|
||||
// 获取指定长度的随机字符串
|
||||
static function getRandChar_l($length){
|
||||
$str = null;
|
||||
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
$max = strlen($strPol) - 1;
|
||||
|
||||
for ($i = 0; $i < $length; $i ++) {
|
||||
$str .= $strPol[rand(0, $max)]; // rand($min,$max)生成介于min和max两个数之间的一个随机整数
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,17 +21,67 @@ Route::domain('dgg-jimai-api', function () {
|
|||
Route::rule('pattern_goods','api/index/pattern_goods');
|
||||
|
||||
//商品分类
|
||||
Route::rule('category_list','api/index/category_list');
|
||||
Route::rule('category_list','api/goods/category_list');
|
||||
//商品列表
|
||||
Route::rule('goods_list','api/index/goods_list');
|
||||
Route::rule('goods_list','api/goods/goods_list');
|
||||
//商品详情
|
||||
Route::rule('goods_info','api/index/goods_info');
|
||||
Route::rule('goods_info','api/goods/goods_info');
|
||||
//愿望清单列表
|
||||
Route::rule('collectgoods_list','api/goods/collectgoods_list');
|
||||
//操作愿望清单
|
||||
Route::rule('handlecollectgoods','api/goods/handlecollectgoods');
|
||||
|
||||
|
||||
|
||||
//添加购物车
|
||||
Route::rule('caet-add','api/cart/add');
|
||||
//删除购物车
|
||||
Route::rule('caet-del','api/cart/del');
|
||||
//变动购物车数量
|
||||
Route::rule('caet-change','api/cart/change');
|
||||
//购物车选中状态
|
||||
Route::rule('caet-selected','api/cart/selected');
|
||||
//购物车列表
|
||||
Route::rule('caet-lists','api/cart/lists');
|
||||
//购物车商品数量
|
||||
Route::rule('caet-cartnum','api/cart/cartnum');
|
||||
|
||||
|
||||
//下单接口
|
||||
Route::rule('order-buy','api/order/buy');
|
||||
//预支付
|
||||
Route::rule('order-prepay','api/payment/prepay');
|
||||
//支付回调
|
||||
Route::rule('order-wxnotify','api/payment/wxnotify');
|
||||
|
||||
|
||||
//授权登陆
|
||||
Route::rule('login','api/auth/login');
|
||||
|
||||
//我的设备
|
||||
Route::rule('u-equipment','api/user/equipment');
|
||||
//我的消息
|
||||
Route::rule('u-notice','api/user/notice');
|
||||
//我的订单列表
|
||||
Route::rule('u-order','api/user/order');
|
||||
//我的订单详情
|
||||
Route::rule('u-orderdetail','api/user/orderdetail');
|
||||
//取消我的订单
|
||||
Route::rule('u-ordercancel','api/user/ordercancel');
|
||||
|
||||
|
||||
//我的地址列表
|
||||
Route::rule('u-addresslists','api/useraddress/lists');
|
||||
//我的地址默认
|
||||
Route::rule('u-addresssetdefault','api/useraddress/setdefault');
|
||||
//我的地址添加
|
||||
Route::rule('u-addressadd','api/useraddress/add');
|
||||
//我的地址编辑
|
||||
Route::rule('u-addressedit','api/useraddress/update');
|
||||
//我的地址删除
|
||||
Route::rule('u-addressdel','api/useraddress/del');
|
||||
|
||||
|
||||
|
||||
|
||||
//收益统计
|
||||
Route::rule('u-profit_census','api/user/profit_census');
|
||||
//提现记录
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
//000001200934
|
||||
exit();?>
|
||||
1639486892
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
//000001157237
|
||||
exit();?>
|
||||
1639539331
|
||||
|
|
@ -0,0 +1,908 @@
|
|||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:23:17+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.975571s] [吞吐率:1.03req/s] [内存消耗:4,447.59kb] [文件加载:185]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '178',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryU9VXzAdYD4906R9x',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.136063s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.092095s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.089950s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.088019s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.087861s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.087262s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `is_default` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.090469s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.092252s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.091679s ]
|
||||
[ error ] [0]variable type error: array[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/Response.php:403]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:24:01+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.755509s] [吞吐率:1.32req/s] [内存消耗:4,348.13kb] [文件加载:180]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '178',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryHuycDNvmdfGDJjcz',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.127911s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.083943s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.082017s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.090605s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.085100s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.085109s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `is_default` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.084655s ]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:24:43+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.039039s] [吞吐率:0.96req/s] [内存消耗:4,388.15kb] [文件加载:181]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '178',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary17yOFLPFfp0R8361',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.138083s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.092725s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.088249s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.088807s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.092399s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.088459s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `is_default` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.088040s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.089314s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.087996s ]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:25:40+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.918297s] [吞吐率:1.09req/s] [内存消耗:4,412.79kb] [文件加载:183]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '178',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundarylibOlo1B2ojfcF3W',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.127582s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.084062s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.082641s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.086931s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.082269s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.084578s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `is_default` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.081466s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.085737s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.085327s ]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:31:08+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.526187s] [吞吐率:0.66req/s] [内存消耗:4,465.28kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '178',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryrVRjpXKXxVWLdKgO',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.132590s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.086334s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.082794s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.083615s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.084209s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.084970s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `is_default` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.082285s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.083696s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.163107s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.084069s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.083918s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.083144s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.083034s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.084399s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142131085952' LIMIT 1 [ RunTime:0.081330s ]
|
||||
[ error ] [8]未定义数组索引: remark[/Library/WebServer/Documents/dggxiangmu/dggjimai/application/common/model/Order.php:209]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:31:22+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.637923s] [吞吐率:0.61req/s] [内存消耗:4,465.31kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '271',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundarycpLMMJMOEecvxdTe',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.131404s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.087593s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.089024s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.089289s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.087900s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.087558s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `is_default` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.086246s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.086396s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.168730s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.087981s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.085678s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.084770s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.086393s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.172511s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142131214303' LIMIT 1 [ RunTime:0.087025s ]
|
||||
[ error ] [8]未定义数组索引: remark[/Library/WebServer/Documents/dggxiangmu/dggjimai/application/common/model/Order.php:209]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:31:50+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.850787s] [吞吐率:1.18req/s] [内存消耗:4,419.54kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryjNGxVbHP5G5FToq0',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.127082s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.084383s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.082323s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.085635s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.082676s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.084108s ]
|
||||
[ error ] [10501]SQLSTATE[42S22]: Column not found: 1054 Unknown column 'del' in 'where clause'[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/db/Connection.php:687]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:35:19+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.807002s] [吞吐率:1.24req/s] [内存消耗:4,413.68kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryB6ymWYm8xhsNugpo',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.127897s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.086355s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.084312s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.086168s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.092284s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.084372s ]
|
||||
[ error ] [10501]SQLSTATE[42S22]: Column not found: 1054 Unknown column 'del' in 'where clause'[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/db/Connection.php:687]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:46:00+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.822726s] [吞吐率:1.22req/s] [内存消耗:4,416.77kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryzwezeNgLhcdAv71I',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.133440s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.089172s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.086490s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.087344s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.087691s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.087032s ]
|
||||
[ error ] [10501]SQLSTATE[42S22]: Column not found: 1054 Unknown column 'del' in 'where clause'[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/db/Connection.php:687]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:48:07+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.816402s] [吞吐率:1.22req/s] [内存消耗:4,414.30kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryMraVQH1DCQpM6H3W',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.132171s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.088685s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.087323s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.086358s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.087768s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.086090s ]
|
||||
[ error ] [10501]SQLSTATE[42S22]: Column not found: 1054 Unknown column 'del' in 'where clause'[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/db/Connection.php:687]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:49:17+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.792693s] [吞吐率:1.26req/s] [内存消耗:4,414.30kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundarye4cCzDyOwcL8Ie44',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.126986s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.094418s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.088304s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.082383s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.083364s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.082257s ]
|
||||
[ error ] [10501]SQLSTATE[42S22]: Column not found: 1054 Unknown column 'del' in 'where clause'[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/db/Connection.php:687]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:49:28+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:0.707517s] [吞吐率:1.41req/s] [内存消耗:4,414.30kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryXdMc8zs17P4ZmJtA',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.136215s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.089534s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.090023s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.089833s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.092921s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.089681s ]
|
||||
[ error ] [10501]SQLSTATE[42S22]: Column not found: 1054 Unknown column 'del' in 'where clause'[/Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/library/think/db/Connection.php:687]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:50:17+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.554946s] [吞吐率:0.64req/s] [内存消耗:4,460.25kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary0FpAAE9ht1DtYybJ',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.133360s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.090955s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.089664s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.086465s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.085277s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.086882s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.089410s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.085420s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.167508s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.086507s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.085915s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.086060s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.089426s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.084781s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142150166090' LIMIT 1 [ RunTime:0.084410s ]
|
||||
[ error ] [8]未定义数组索引: remark[/Library/WebServer/Documents/dggxiangmu/dggjimai/application/common/model/Order.php:211]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:50:45+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.555593s] [吞吐率:0.64req/s] [内存消耗:4,460.25kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryTZGw1sNExi4dNULe',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.131996s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.087600s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.085279s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.086863s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.084814s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.086758s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.084836s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.088221s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.168835s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.088583s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.092605s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.085515s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.084736s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.085785s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142150454300' LIMIT 1 [ RunTime:0.083207s ]
|
||||
[ error ] [8]未定义数组索引: remark[/Library/WebServer/Documents/dggxiangmu/dggjimai/application/common/model/Order.php:211]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:51:40+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:2.362096s] [吞吐率:0.42req/s] [内存消耗:4,453.25kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryWfbVSgsEQDU9rUPF',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.125288s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.084374s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.082687s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.083539s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.082640s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.084313s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.087538s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.082455s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.163243s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.089222s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.217394s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.227904s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.082058s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.185566s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142151395122' LIMIT 1 [ RunTime:0.169778s ]
|
||||
[ sql ] [ SQL ] INSERT INTO `order` (`order_sn` , `user_id` , `consignee` , `province` , `city` , `district` , `address` , `mobile` , `total_goods_price` , `order_amount` , `total_amount` , `total_num` , `user_remark` , `create_time`) VALUES ('202112142151395122' , 1 , '测试' , 360000 , 360100 , 360102 , '测试测试' , '17761236475' , 9596 , 9596 , 9596 , 4 , '' , 1639489899) [ RunTime:0.261602s ]
|
||||
[ error ] [0]致命错误: Class 'app\common\model\Db' not found[/Library/WebServer/Documents/dggxiangmu/dggjimai/application/common/model/OrderGoods.php:25]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:52:09+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:2.305160s] [吞吐率:0.43req/s] [内存消耗:4,417.48kb] [文件加载:185]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryfIHMin1ieD5CbEXt',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.136079s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.090598s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.090041s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.088814s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.087450s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.089086s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.088968s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.086971s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.181016s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.089047s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.090581s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.087128s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.088938s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.089981s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142152086394' LIMIT 1 [ RunTime:0.085611s ]
|
||||
[ sql ] [ SQL ] INSERT INTO `order` (`order_sn` , `user_id` , `consignee` , `province` , `city` , `district` , `address` , `mobile` , `total_goods_price` , `order_amount` , `total_amount` , `total_num` , `user_remark` , `create_time`) VALUES ('202112142152086394' , 1 , '测试' , 360000 , 360100 , 360102 , '测试测试' , '17761236475' , 9596 , 9596 , 9596 , 4 , '' , 1639489928) [ RunTime:0.088275s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `goods` [ RunTime:0.087901s ]
|
||||
[ sql ] [ SQL ] UPDATE `goods` SET `order_num` = order_num+4 , `stock` = stock-4 WHERE `id` = 2 [ RunTime:0.089584s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `goods_item` [ RunTime:0.088340s ]
|
||||
[ sql ] [ SQL ] UPDATE `goods_item` SET `stock` = `stock` - 4 WHERE `goods_id` = 2 AND `spec_value` = 'M' [ RunTime:0.087056s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`stock` FROM `goods` WHERE `id` = 2 [ RunTime:0.087059s ]
|
||||
[ sql ] [ SQL ] DELETE FROM `cart` WHERE `user_id` = 1 AND `selected` = 1 AND `item_value` = 'M' [ RunTime:0.088164s ]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:52:34+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.605237s] [吞吐率:0.62req/s] [内存消耗:4,436.25kb] [文件加载:187]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryE4cIPpq6POKDm92Y',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.126272s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.084379s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.081154s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.083016s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.085239s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.084286s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.083173s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.084928s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.203806s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.085890s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.086856s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.082636s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.080727s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.081726s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142152343577' LIMIT 1 [ RunTime:0.080642s ]
|
||||
[ sql ] [ SQL ] INSERT INTO `order` (`order_sn` , `user_id` , `consignee` , `province` , `city` , `district` , `address` , `mobile` , `total_goods_price` , `order_amount` , `total_amount` , `total_num` , `user_remark` , `create_time`) VALUES ('202112142152343577' , 1 , '测试' , 360000 , 360100 , 360102 , '测试测试' , '17761236475' , 0 , 0 , 0 , 0 , '' , 1639489954) [ RunTime:0.080274s ]
|
||||
[ error ] [8]未定义变量: goods_data[/Library/WebServer/Documents/dggxiangmu/dggjimai/application/common/model/Order.php:261]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:54:28+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:1.247342s] [吞吐率:0.80req/s] [内存消耗:4,839.83kb] [文件加载:182]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary87knPLymZg5Bl2oT',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.139461s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.090680s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.086781s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.089977s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.088108s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.090381s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.088521s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.087507s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.174973s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.088678s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.089491s ]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:54:54+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/caet-add
|
||||
[运行时间:0.963095s] [吞吐率:1.04req/s] [内存消耗:4,287.43kb] [文件加载:180]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'caet-add',
|
||||
'route' => 'api/cart/add',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '512',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundarybVA0T2aFqtRShJKX',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'goods_id' => 'bd72ddaaLnYfLS+0mm354D1XTZsgEj+FcfS3O22d+dpc',
|
||||
'item_value' => 'M',
|
||||
'goods_num' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.131382s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.086208s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.085000s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.089296s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `cart` WHERE `user_id` = 1 AND `goods_id` = 2 AND `item_value` = 'M' LIMIT 1 [ RunTime:0.086168s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `goods_item` [ RunTime:0.085891s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `goods_item` WHERE `goods_id` = 2 AND `spec_value` = 'M' LIMIT 1 [ RunTime:0.083707s ]
|
||||
[ sql ] [ SQL ] INSERT INTO `cart` (`user_id` , `goods_id` , `goods_num` , `item_value` , `create_time`) VALUES (1 , 2 , 1 , 'M' , 1639490094) [ RunTime:0.087344s ]
|
||||
---------------------------------------------------------------
|
||||
|
||||
[2021-12-14T21:55:02+08:00] 127.0.0.1 POST dgg-jimai-api.dggjimai.com/order-buy
|
||||
[运行时间:2.268638s] [吞吐率:0.44req/s] [内存消耗:4,417.99kb] [文件加载:185]
|
||||
[ info ] [ LANG ] /Library/WebServer/Documents/dggxiangmu/dggjimai/thinkphp/lang/zh-cn.php
|
||||
[ info ] [ ROUTE ] array (
|
||||
'rule' => 'order-buy',
|
||||
'route' => 'api/order/buy',
|
||||
'option' =>
|
||||
array (
|
||||
'merge_rule_regex' => false,
|
||||
),
|
||||
'var' =>
|
||||
array (
|
||||
),
|
||||
)
|
||||
[ info ] [ HEADER ] array (
|
||||
'host' => 'dgg-jimai-api.dggjimai.com',
|
||||
'connection' => 'keep-alive',
|
||||
'content-length' => '369',
|
||||
'accept' => 'application/json, text/javascript, */*; q=0.01',
|
||||
'accept-encoding' => 'gzip, deflate',
|
||||
'accept-language' => 'zh-CN',
|
||||
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundaryUSsy8wMGgn6pDBeM',
|
||||
'origin' => 'http://dgg-jimai-api.dggjimai.com',
|
||||
'user-agent' => 'ApiPOST Runtime +https://www.apipost.cn',
|
||||
'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3MiLCJhdWQiOiJhdWQiLCJqdGkiOiIwYzY5YTFkZjEyOTMyYWRmMjA2MzBiYzY4Y2ViMmVlNSIsImlhdCI6MTYzOTQ4Njk2NywibmJmIjoxNjM5NDg2OTY3LCJleHAiOjE2Mzk0OTQxNjcsInVpZCI6MX0.TgJVleOWfg_DcdpGzqNelxgnQVFSzlrzLsBlVTwBAYI',
|
||||
)
|
||||
[ info ] [ PARAM ] array (
|
||||
'uid' => '465f91fejJh/L7IqfSBww3ddZHHvH5mUS5mw6qGbVWkN',
|
||||
'remark' => '',
|
||||
'address_id' => '1',
|
||||
)
|
||||
[ info ] [ DB ] INIT mysql
|
||||
[ sql ] [ DB ] CONNECT:[ UseTime:0.133063s ] mysql:host=114.215.82.135;port=3306;dbname=dgg_jimai;charset=utf8mb4
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `shop_config` [ RunTime:0.088058s ]
|
||||
[ sql ] [ SQL ] SELECT `value` FROM `shop_config` WHERE `type` = 'website' AND `name` = 'img_url' LIMIT 1 [ RunTime:0.086647s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `cart` [ RunTime:0.089023s ]
|
||||
[ sql ] [ SQL ] SELECT mi.thumb_image as goods_img,g.name as goods_name,g.price as goods_price,g.id as goods_id,gb.name as brand_name,`c`.`goods_num`,`item_value`,`g`.`status`,`g`.`stock`,`g`.`original_price` FROM `cart` `c` INNER JOIN `goods` `g` ON `g`.`id`=`c`.`goods_id` INNER JOIN `goods_brand` `gb` ON `gb`.`id`=`g`.`brand_id` LEFT JOIN `mall_image` `mi` ON `mi`.`union_id`=c.goods_id and is_cover=1 and mi.type=1 WHERE `c`.`user_id` = '1' AND `selected` = 1 [ RunTime:0.115114s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user_address` [ RunTime:0.088343s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`contact`,`telephone`,`province_id`,`city_id`,`district_id`,`address`,`is_default` FROM `user_address` WHERE `id` = 1 AND `user_id` = 1 LIMIT 1 [ RunTime:0.085921s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `dev_region` [ RunTime:0.087036s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.171767s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.088521s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`name` FROM `dev_region` [ RunTime:0.088514s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `user` [ RunTime:0.087742s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `user` WHERE ( `id` = 1 ) AND `user`.`delete_time` = 0 LIMIT 1 [ RunTime:0.088423s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `order` [ RunTime:0.088803s ]
|
||||
[ sql ] [ SQL ] SELECT * FROM `order` WHERE `order_sn` = '202112142155017364' LIMIT 1 [ RunTime:0.085618s ]
|
||||
[ sql ] [ SQL ] INSERT INTO `order` (`order_sn` , `user_id` , `consignee` , `province` , `city` , `district` , `address` , `mobile` , `total_goods_price` , `order_amount` , `total_amount` , `total_num` , `user_remark` , `create_time`) VALUES ('202112142155017364' , 1 , '测试' , 360000 , 360100 , 360102 , '测试测试' , '17761236475' , 2399 , 2399 , 2399 , 1 , '' , 1639490101) [ RunTime:0.088567s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `goods` [ RunTime:0.086669s ]
|
||||
[ sql ] [ SQL ] UPDATE `goods` SET `order_num` = order_num+1 , `stock` = stock-1 WHERE `id` = 2 [ RunTime:0.088463s ]
|
||||
[ sql ] [ SQL ] SHOW COLUMNS FROM `goods_item` [ RunTime:0.087011s ]
|
||||
[ sql ] [ SQL ] UPDATE `goods_item` SET `stock` = `stock` - 1 WHERE `goods_id` = 2 AND `spec_value` = 'M' [ RunTime:0.085716s ]
|
||||
[ sql ] [ SQL ] SELECT `id`,`stock` FROM `goods` WHERE `id` = 2 [ RunTime:0.086081s ]
|
||||
[ sql ] [ SQL ] DELETE FROM `cart` WHERE `user_id` = 1 AND `selected` = 1 AND `item_value` = 'M' [ RunTime:0.089982s ]
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue