增加管理系统中物流列表和物流详情接口

This commit is contained in:
luofei 2023-08-10 16:17:46 +08:00
parent a0d6e12927
commit 29c1757a32
9 changed files with 463 additions and 473 deletions

View File

@ -13,13 +13,13 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\controller; namespace app\adminapi\controller\logistics;
use app\adminapi\controller\BaseAdminController; use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\LogisticsLists; use app\adminapi\lists\logistics\LogisticsLists;
use app\adminapi\logic\LogisticsLogic; use app\adminapi\logic\logistics\LogisticsLogic;
use app\adminapi\validate\LogisticsValidate; use app\adminapi\validate\logistics\LogisticsValidate;
/** /**
@ -35,7 +35,7 @@ class LogisticsController extends BaseAdminController
* @notes 获取列表 * @notes 获取列表
* @return \think\response\Json * @return \think\response\Json
* @author likeadmin * @author likeadmin
* @date 2023/08/07 15:00 * @date 2023/08/10 15:41
*/ */
public function lists() public function lists()
{ {
@ -48,12 +48,13 @@ class LogisticsController extends BaseAdminController
* @notes 获取详情 * @notes 获取详情
* @return \think\response\Json * @return \think\response\Json
* @author likeadmin * @author likeadmin
* @date 2023/08/07 15:00 * @date 2023/08/10 15:41
*/ */
public function detail() public function detail()
{ {
$params = (new LogisticsValidate())->goCheck('detail'); $params = (new LogisticsValidate())->goCheck('detail');
$result = LogisticsLogic::detail($params); $result = LogisticsLogic::detail($params);
dump($result);die;
return $this->data($result); return $this->data($result);
} }

View File

@ -16,10 +16,10 @@
namespace app\adminapi\controller; namespace app\adminapi\controller;
use app\adminapi\controller\BaseAdminController; use app\adminapi\controller\logistics\BaseAdminController;
use app\adminapi\lists\LogisticsRecordLists; use app\adminapi\lists\logistics\LogisticsRecordLists;
use app\adminapi\logic\LogisticsRecordLogic; use app\adminapi\logic\logistics\LogisticsRecordLogic;
use app\adminapi\validate\LogisticsRecordValidate; use app\adminapi\validate\logistics\LogisticsRecordValidate;
/** /**

View File

@ -1,77 +1,87 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版 // | likeadmin快速开发前后端分离管理后台PHP版
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力 // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo // | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin // | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin // | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn // | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权 // | likeadmin团队 版权所有 拥有最终解释权
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\lists; namespace app\adminapi\lists\logistics;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\Logistics; use app\common\model\logistics\Courier;
use app\common\lists\ListsSearchInterface; use app\common\model\logistics\Logistics;
use app\common\lists\ListsSearchInterface;
/**
* Logistics列表 /**
* Class LogisticsLists * Logistics列表
* @package app\adminapi\lists * Class LogisticsLists
*/ * @package app\adminapi\lists
class LogisticsLists extends BaseAdminDataLists implements ListsSearchInterface */
{ class LogisticsLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件 /**
* @return \string[][] * @notes 设置搜索条件
* @author likeadmin * @return \string[][]
* @date 2023/08/07 15:00 * @author likeadmin
*/ * @date 2023/08/10 15:41
public function setSearch(): array */
{ public function setSearch(): array
return [ {
'=' => ['order_id', 'order_sn', 'courier_id', 'shop_name', 'shop_phone', 'shop_address', 'user_name', 'user_phone', 'user_address', 'status'], return [
]; '=' => ['order_id', 'order_sn', 'courier_id', 'shop_id', 'shop_name', 'shop_phone', 'shop_address', 'shop_long', 'shop_lat', 'user_id', 'user_name', 'user_phone', 'user_address', 'status', 'qh_time', 'ps_time', 'qx_time', 'user_take_code'],
}
];
}
/**
* @notes 获取列表
* @return array /**
* @throws \think\db\exception\DataNotFoundException * @notes 获取列表
* @throws \think\db\exception\DbException * @return array
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\DataNotFoundException
* @author likeadmin * @throws \think\db\exception\DbException
* @date 2023/08/07 15:00 * @throws \think\db\exception\ModelNotFoundException
*/ * @author likeadmin
public function lists(): array * @date 2023/08/10 15:41
{ */
return Logistics::where($this->searchWhere) public function lists(): array
->field(['id', 'order_id', 'order_sn', 'courier_id', 'shop_name', 'shop_phone', 'shop_address', 'user_name', 'user_phone', 'user_address', 'status']) {
->limit($this->limitOffset, $this->limitLength) return Logistics::where($this->searchWhere)
->order(['id' => 'desc']) ->field(['id', 'order_id', 'order_sn', 'courier_id', 'shop_id', 'shop_name', 'shop_phone', 'shop_address', 'shop_long', 'shop_lat', 'user_id', 'user_name', 'user_phone', 'user_address', 'status', 'qh_time', 'ps_time', 'qx_time', 'user_take_code'])
->select() ->limit($this->limitOffset, $this->limitLength)
->toArray(); ->order(['id' => 'desc'])
} ->select()
->each(function ($item) {
$item['status_name'] = $item->status_name;
/** $item['courier'] = Courier::alias('u')
* @notes 获取数量 ->field('u.nickname,a.phone')
* @return int ->leftjoin('la_admin a', 'u.admin_id = a.id')
* @author likeadmin ->where('u.id', $item['courier_id'])->find();
* @date 2023/08/07 15:00 return $item;
*/ })
public function count(): int ->toArray();
{ }
return Logistics::where($this->searchWhere)->count();
}
/**
* @notes 获取数量
* @return int
* @author likeadmin
* @date 2023/08/10 15:41
*/
public function count(): int
{
return Logistics::where($this->searchWhere)->count();
}
} }

View File

@ -1,77 +1,78 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版 // | likeadmin快速开发前后端分离管理后台PHP版
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力 // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo // | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin // | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin // | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn // | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权 // | likeadmin团队 版权所有 拥有最终解释权
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\lists; namespace app\adminapi\lists;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\logistics\BaseAdminDataLists;
use app\common\model\LogisticsRecord; use app\common\model\LogisticsRecord;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
/** /**
* LogisticsRecord列表 * LogisticsRecord列表
* Class LogisticsRecordLists * Class LogisticsRecordLists
* @package app\adminapi\lists * @package app\adminapi\lists
*/ */
class LogisticsRecordLists extends BaseAdminDataLists implements ListsSearchInterface class LogisticsRecordLists extends BaseAdminDataLists implements ListsSearchInterface
{ {
/** /**
* @notes 设置搜索条件 * @notes 设置搜索条件
* @return \string[][] * @return \string[][]
* @author likeadmin * @author likeadmin
* @date 2023/08/07 15:00 * @date 2023/08/07 15:00
*/ */
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['lst_id', 'type', 'user_name', 'user_phone', 'content'], '=' => ['lst_id', 'type', 'user_name', 'user_phone', 'content'],
];
} ];
}
/**
* @notes 获取列表 /**
* @return array * @notes 获取列表
* @throws \think\db\exception\DataNotFoundException * @return array
* @throws \think\db\exception\DbException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\DbException
* @author likeadmin * @throws \think\db\exception\ModelNotFoundException
* @date 2023/08/07 15:00 * @author likeadmin
*/ * @date 2023/08/07 15:00
public function lists(): array */
{ public function lists(): array
return LogisticsRecord::where($this->searchWhere) {
->field(['id', 'lst_id', 'type', 'user_name', 'user_phone', 'content']) return LogisticsRecord::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength) ->field(['id', 'lst_id', 'type', 'user_name', 'user_phone', 'content'])
->order(['id' => 'desc']) ->limit($this->limitOffset, $this->limitLength)
->select() ->order(['id' => 'desc'])
->toArray(); ->select()
} ->toArray();
}
/**
* @notes 获取数量 /**
* @return int * @notes 获取数量
* @author likeadmin * @return int
* @date 2023/08/07 15:00 * @author likeadmin
*/ * @date 2023/08/07 15:00
public function count(): int */
{ public function count(): int
return LogisticsRecord::where($this->searchWhere)->count(); {
} return LogisticsRecord::where($this->searchWhere)->count();
}
} }

View File

@ -12,12 +12,14 @@
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\logic; namespace app\adminapi\logic\logistics;
use app\common\model\Logistics; use app\common\model\logistics\Courier;
use app\common\model\logistics\Logistics;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use think\facade\Db; use app\common\model\logistics\LogisticsRecord;
use app\common\model\logistics\Product;
/** /**
@ -28,97 +30,54 @@ use think\facade\Db;
class LogisticsLogic extends BaseLogic class LogisticsLogic extends BaseLogic
{ {
/**
* @notes 添加
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/08/07 15:00
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
Logistics::create([
'order_id' => $params['order_id'],
'order_sn' => $params['order_sn'],
'courier_id' => $params['courier_id'],
'shop_name' => $params['shop_name'],
'shop_phone' => $params['shop_phone'],
'shop_address' => $params['shop_address'],
'user_name' => $params['user_name'],
'user_phone' => $params['user_phone'],
'user_address' => $params['user_address'],
'status' => $params['status'],
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/08/07 15:00
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
Logistics::where('id', $params['id'])->update([
'order_id' => $params['order_id'],
'order_sn' => $params['order_sn'],
'courier_id' => $params['courier_id'],
'shop_name' => $params['shop_name'],
'shop_phone' => $params['shop_phone'],
'shop_address' => $params['shop_address'],
'user_name' => $params['user_name'],
'user_phone' => $params['user_phone'],
'user_address' => $params['user_address'],
'status' => $params['status'],
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/08/07 15:00
*/
public static function delete(array $params): bool
{
return Logistics::destroy($params['id']);
}
/** /**
* @notes 获取详情 * @notes 获取详情
* @param $params * @param $params
* @return array * @return array
* @author likeadmin * @author likeadmin
* @date 2023/08/07 15:00 * @date 2023/08/10 15:41
*/ */
public static function detail($params): array public static function detail($params): array
{ {
return Logistics::findOrEmpty($params['id'])->toArray(); $logistics = Logistics::findOrEmpty($params['id']);
$logistics['status_name'] = $logistics->status_name;
//获取配送员信息
$courier = Courier::alias('u')
->field('u.nickname,a.phone')
->leftjoin('la_admin a', 'u.admin_id = a.id')
->where('u.id', $logistics['courier_id'])->find();
$logistics['courier'] = $courier;
//获取商品信息
$product_count = 0;
$product = Product::field('product_num,cart_info')->where('order_id', $logistics['order_id'])->select()->each(function($pro_item) use(&$product_count){
$pro_item['cart_info'] = json_decode($pro_item['cart_info'], true);
$pro_item['goods_name'] = $pro_item['cart_info']['product']['store_name'];
$pro_item['goods_unit'] = $pro_item['cart_info']['product']['unit_name'];
$product_count += $pro_item['product_num'];
unset($pro_item['cart_info']);
return $pro_item;
})->toArray();
$logistics['product'] = $product;
//获取物流记录
$records = LogisticsRecord::field('type,user_name,content,create_time')
->where('lst_id', $logistics['id'])->order('create_time desc')->select()->each(function($red_item){
switch ($red_item['type']) {
case 1:
$red_item['content'] = '用户'.$red_item['user_name'].$red_item['content'];
break;
case 2:
$red_item['content'] = '配送员'.$red_item['user_name'].$red_item['content'];
break;
case 3:
$red_item['content'] = '平台'.$red_item['user_name'].$red_item['content'];
break;
default:
$red_item['content'] = '未知';
}
unset($red_item['type'], $red_item['user_name']);
})->toArray();
$logistics['records'] = $records;
//返回数据
return $logistics->toArray();
} }
} }

View File

@ -12,7 +12,7 @@
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\logic; namespace app\adminapi\logic\logistics;
use app\common\model\LogisticsRecord; use app\common\model\LogisticsRecord;

View File

@ -1,104 +1,106 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版 // | likeadmin快速开发前后端分离管理后台PHP版
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力 // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo // | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin // | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin // | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn // | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权 // | likeadmin团队 版权所有 拥有最终解释权
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\validate; namespace app\adminapi\validate\logistics;
use app\common\validate\BaseValidate; use app\common\validate\BaseValidate;
/** /**
* LogisticsRecord验证器 * LogisticsRecord验证器
* Class LogisticsRecordValidate * Class LogisticsRecordValidate
* @package app\adminapi\validate * @package app\adminapi\validate
*/ */
class LogisticsRecordValidate extends BaseValidate class LogisticsRecordValidate extends BaseValidate
{ {
/** /**
* 设置校验规则 * 设置校验规则
* @var string[] * @var string[]
*/ */
protected $rule = [ protected $rule = [
'id' => 'require', 'id' => 'require',
'lst_id' => 'require', 'lst_id' => 'require',
'type' => 'require', 'type' => 'require',
'user_name' => 'require', 'user_name' => 'require',
'user_phone' => 'require', 'user_phone' => 'require',
'content' => 'require', 'content' => 'require',
];
];
/**
* 参数描述 /**
* @var string[] * 参数描述
*/ * @var string[]
protected $field = [ */
'id' => 'id', protected $field = [
'lst_id' => '物流信息id', 'id' => 'id',
'type' => '操作类型 1用户操作 2配送员操作 3平台操作', 'lst_id' => '物流信息id',
'user_name' => '操作者名称', 'type' => '操作类型 1用户操作 2配送员操作 3平台操作',
'user_phone' => '操作者电话', 'user_name' => '操作者名称',
'content' => '操作详情', 'user_phone' => '操作者电话',
]; 'content' => '操作详情',
];
/**
* @notes 添加场景
* @return LogisticsRecordValidate /**
* @author likeadmin * @notes 添加场景
* @date 2023/08/07 15:00 * @return LogisticsRecordValidate
*/ * @author likeadmin
public function sceneAdd() * @date 2023/08/07 15:00
{ */
return $this->only(['lst_id','type','user_name','user_phone','content']); public function sceneAdd()
} {
return $this->only(['lst_id','type','user_name','user_phone','content']);
}
/**
* @notes 编辑场景
* @return LogisticsRecordValidate /**
* @author likeadmin * @notes 编辑场景
* @date 2023/08/07 15:00 * @return LogisticsRecordValidate
*/ * @author likeadmin
public function sceneEdit() * @date 2023/08/07 15:00
{ */
return $this->only(['id','lst_id','type','user_name','user_phone','content']); public function sceneEdit()
} {
return $this->only(['id','lst_id','type','user_name','user_phone','content']);
}
/**
* @notes 删除场景
* @return LogisticsRecordValidate /**
* @author likeadmin * @notes 删除场景
* @date 2023/08/07 15:00 * @return LogisticsRecordValidate
*/ * @author likeadmin
public function sceneDelete() * @date 2023/08/07 15:00
{ */
return $this->only(['id']); public function sceneDelete()
} {
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return LogisticsRecordValidate /**
* @author likeadmin * @notes 详情场景
* @date 2023/08/07 15:00 * @return LogisticsRecordValidate
*/ * @author likeadmin
public function sceneDetail() * @date 2023/08/07 15:00
{ */
return $this->only(['id']); public function sceneDetail()
} {
return $this->only(['id']);
}
} }

View File

@ -1,119 +1,136 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版 // | likeadmin快速开发前后端分离管理后台PHP版
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力 // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo // | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin // | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin // | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn // | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权 // | likeadmin团队 版权所有 拥有最终解释权
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\validate; namespace app\adminapi\validate\logistics;
use app\common\validate\BaseValidate; use app\common\validate\BaseValidate;
/** /**
* Logistics验证器 * Logistics验证器
* Class LogisticsValidate * Class LogisticsValidate
* @package app\adminapi\validate * @package app\adminapi\validate
*/ */
class LogisticsValidate extends BaseValidate class LogisticsValidate extends BaseValidate
{ {
/** /**
* 设置校验规则 * 设置校验规则
* @var string[] * @var string[]
*/ */
protected $rule = [ protected $rule = [
'id' => 'require', 'id' => 'require',
'order_id' => 'require', 'order_id' => 'require',
'order_sn' => 'require', 'order_sn' => 'require',
'courier_id' => 'require', 'courier_id' => 'require',
'shop_name' => 'require', 'shop_id' => 'require',
'shop_phone' => 'require', 'shop_name' => 'require',
'shop_address' => 'require', 'shop_phone' => 'require',
'user_name' => 'require', 'shop_address' => 'require',
'user_phone' => 'require', 'shop_long' => 'require',
'user_address' => 'require', 'shop_lat' => 'require',
'status' => 'require', 'user_id' => 'require',
]; 'user_name' => 'require',
'user_phone' => 'require',
'user_address' => 'require',
/** 'status' => 'require',
* 参数描述 'qh_time' => 'require',
* @var string[] 'ps_time' => 'require',
*/ 'qx_time' => 'require',
protected $field = [ 'user_take_code' => 'require',
'id' => 'id',
'order_id' => '订单id', ];
'order_sn' => '订单编号',
'courier_id' => '配送人员id',
'shop_name' => '商家名称', /**
'shop_phone' => '商家联系电话', * 参数描述
'shop_address' => '商家联系地址', * @var string[]
'user_name' => '买家名称', */
'user_phone' => '买家联系电话', protected $field = [
'user_address' => '买家收货地址', 'id' => 'id',
'status' => '物流状态 'order_id' => '订单id',
0:待揽件 'order_sn' => '订单编号',
1:配送中 'courier_id' => '配送人员id',
2:已配送(快递员已配送,买家未确认收货) 'shop_id' => '商家id',
3:已完成 'shop_name' => '商家名称',
4:已取消', 'shop_phone' => '商家联系电话',
]; 'shop_address' => '商家联系地址',
'shop_long' => '商家地址经度',
'shop_lat' => '商家地址纬度',
/** 'user_id' => '买家会员id',
* @notes 添加场景 'user_name' => '买家名称',
* @return LogisticsValidate 'user_phone' => '买家联系电话',
* @author likeadmin 'user_address' => '买家收货地址',
* @date 2023/08/07 15:00 'status' => '物流状态
*/ 0:待揽件
public function sceneAdd() 1:配送中
{ 2:已配送
return $this->only(['order_id','order_sn','courier_id','shop_name','shop_phone','shop_address','user_name','user_phone','user_address','status']); 3:已取消',
} 'qh_time' => 'qh_time',
'ps_time' => 'ps_time',
'qx_time' => 'qx_time',
/** 'user_take_code' => '用户取件码',
* @notes 编辑场景
* @return LogisticsValidate ];
* @author likeadmin
* @date 2023/08/07 15:00
*/ /**
public function sceneEdit() * @notes 添加场景
{ * @return LogisticsValidate
return $this->only(['id','order_id','order_sn','courier_id','shop_name','shop_phone','shop_address','user_name','user_phone','user_address','status']); * @author likeadmin
} * @date 2023/08/10 15:41
*/
public function sceneAdd()
/** {
* @notes 删除场景 return $this->only(['order_id','order_sn','courier_id','shop_id','shop_name','shop_phone','shop_address','shop_long','shop_lat','user_id','user_name','user_phone','user_address','status','qh_time','ps_time','qx_time','user_take_code']);
* @return LogisticsValidate }
* @author likeadmin
* @date 2023/08/07 15:00
*/ /**
public function sceneDelete() * @notes 编辑场景
{ * @return LogisticsValidate
return $this->only(['id']); * @author likeadmin
} * @date 2023/08/10 15:41
*/
public function sceneEdit()
/** {
* @notes 详情场景 return $this->only(['id','order_id','order_sn','courier_id','shop_id','shop_name','shop_phone','shop_address','shop_long','shop_lat','user_id','user_name','user_phone','user_address','status','qh_time','ps_time','qx_time','user_take_code']);
* @return LogisticsValidate }
* @author likeadmin
* @date 2023/08/07 15:00
*/ /**
public function sceneDetail() * @notes 删除场景
{ * @return LogisticsValidate
return $this->only(['id']); * @author likeadmin
} * @date 2023/08/10 15:41
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return LogisticsValidate
* @author likeadmin
* @date 2023/08/10 15:41
*/
public function sceneDetail()
{
return $this->only(['id']);
}
} }

View File

@ -31,7 +31,7 @@ class Logistics extends BaseModel
public function getStatusNameAttr($value,$data): string public function getStatusNameAttr($value,$data): string
{ {
$status = [0=>'待取货',1=>'配送中',2=>'已配送',3=>'已完成',4=>'已取消']; $status = [0=>'待取货',1=>'配送中',2=>'已配送',3=>'已取消'];
return $status[$data['status']]; return $status[$data['status']];
} }
@ -50,7 +50,7 @@ class Logistics extends BaseModel
return !empty($value) ? date('Y-m-d H:i:s',$value) : $value; return !empty($value) ? date('Y-m-d H:i:s',$value) : $value;
} }
public function getPcTimeAttr($value): string public function getPsTimeAttr($value): string
{ {
return !empty($value) ? date('Y-m-d H:i:s',$value) : $value; return !empty($value) ? date('Y-m-d H:i:s',$value) : $value;
} }