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

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

View File

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

View File

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

View File

@ -12,12 +12,14 @@
// | 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 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
{
/**
* @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 获取详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/08/07 15:00
* @date 2023/08/10 15:41
*/
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
// +----------------------------------------------------------------------
namespace app\adminapi\logic;
namespace app\adminapi\logic\logistics;
use app\common\model\LogisticsRecord;

View File

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

View File

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