Merge branch 'v5.1.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.1.0dev

This commit is contained in:
From-wh 2023-06-12 18:38:12 +08:00
commit 48eeed4a27
23 changed files with 71 additions and 31 deletions

View File

@ -242,7 +242,7 @@ class StoreOrder extends AuthController
['delivery_id', ''],//快递单号
['delivery_code', ''],//快递公司编码
['express_record_type', 2],//发货记录类型
['express_record_type', 2],//发货记录类型:2=电子面单;3=商家寄件
['express_temp_id', ""],//电子面单模板
['to_name', ''],//寄件人姓名
['to_tel', ''],//寄件人电话
@ -465,7 +465,7 @@ class StoreOrder extends AuthController
*/
public function order_info($id)
{
if (!$id || !($orderInfo = $this->services->get($id, [], ['refund','invoice']))) {
if (!$id || !($orderInfo = $this->services->get($id, [], ['refund', 'invoice']))) {
return app('json')->fail(400118);
}
/** @var UserServices $services */

View File

@ -217,8 +217,8 @@ class PublicController
/**
* 图片上传
* @param Request $request
* @param SystemAttachmentServices $services
* @return mixed
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function upload_image(Request $request, SystemAttachmentServices $services)
{

View File

@ -255,10 +255,11 @@ class StoreOrderController
$orderInfo = $this->services->get(['order_id' => $uni]);
$uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid;
$orderInfo->is_channel = $this->getChennel[$request->getFromType()] ?? ($request->isApp() ? 0 : 1);
$orderInfo->order_id = $uid != $orderInfo->pay_uid ? app()->make(StoreOrderCreateServices::class)->getNewOrderId('cp') : $uni;
$orderInfo->pay_uid = $uid;
$orderInfo->save();
$orderInfo = $orderInfo->toArray();
$order = $this->services->get(['order_id' => $uni]);
$order = $this->services->get(['order_id' => $orderInfo['order_id']]);
if (!$order)
return app('json')->fail(410173);
if ($order['paid'])
@ -793,4 +794,42 @@ class StoreOrderController
$cartProduct['order_id'] = $this->services->value(['id' => $cartInfo['oid']], 'order_id');
return app('json')->success($cartProduct);
}
/**
* 商家寄件回调
* @param Request $request
* @return \think\Response
* @author 等风来
* @email 136327134@qq.com
* @date 2023/6/12
*/
public function callBack(Request $request)
{
$data = $request->postMore([
['t', ''],
['sign', ''],
['type', ''],
['data', ''],
]);
if (md5(json_encode($data['data']) . $data['t']) != $data['sign']) {
return app('json')->fail();
}
switch ($data['type']) {
case 'order_success':
$update = [
'label' => $data['data']['label'] ?? '',
];
if (isset($data['kuaidinum'])) {
$update['delivery_id'] = $data['kuaidinum'];
}
if (isset($data['task_id'])) {
$this->services->update(['task_id' => $data['task_id']], $update);
}
break;
}
return app('json')->success();
}
}

View File

@ -18,6 +18,7 @@ Route::group(function () {
Route::any('wechat/serve', 'v1.wechat.WechatController/serve')->option(['real_name' => '公众号服务']);//公众号服务
Route::any('wechat/miniServe', 'v1.wechat.WechatController/miniServe')->option(['real_name' => '小程序服务']);//公众号服务
Route::any('pay/notify/:type', 'v1.PayController/notify')->option(['real_name' => '支付回调']);//支付回调
Route::any('order_call_back', 'v1.order.StoreOrderController/callBack')->option(['real_name' => '商家寄件回调']);//商家寄件回调
Route::get('get_script', 'v1.PublicController/getScript')->option(['real_name' => '获取统计代码']);//获取统计代码
Route::get('version', 'v1.PublicController/getVersion')->option(['real_name' => '获取代码版本号']);
})->option(['mark' => 'serve', 'mark_name' => '服务接口']);

View File

@ -59,7 +59,7 @@ class ArticleCategoryDao extends BaseDao
public function getArticleCategory()
{
return $this->search(['hidden' => 0, 'is_del' => 0, 'status' => 1, 'pid' => 0])->with(['children'])
->order('sort DESC')
->order('sort DESC,id DESC')
->field('id,pid,title')
->select()->toArray();
}
@ -77,7 +77,7 @@ class ArticleCategoryDao extends BaseDao
->where('hidden', 0)
->where('is_del', 0)
->where('status', 1)
->order('sort DESC')
->order('sort DESC,id DESC')
->field('id,pid,title')
->select()->toArray();
}

View File

@ -47,7 +47,7 @@ class PageCategoryDao extends BaseDao
{
return $this->search($where)->field($field)->when($page && $limit, function ($query) use ($page, $limit) {
$query->page();
})->order('sort desc')->select()->toArray();
})->order('sort desc,id DESC')->select()->toArray();
}
}

View File

@ -702,7 +702,7 @@ class StoreOrderDao extends BaseDao
$query->field("sum($sumField) as number,FROM_UNIXTIME($group, '$timeUinx') as time");
$query->group("FROM_UNIXTIME($group, '$timeUinx')");
})
->order('pay_time ASC')->select()->toArray();
->order('pay_time ASC,id DESC')->select()->toArray();
}
/**时间分组订单数统计
@ -730,7 +730,7 @@ class StoreOrderDao extends BaseDao
$query->field("count($sumField) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
$query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
})
->order('pay_time ASC')->select()->toArray();
->order('pay_time ASC,id DESC')->select()->toArray();
}
/**时间段支付订单人数
@ -773,7 +773,7 @@ class StoreOrderDao extends BaseDao
$query->field("count(distinct uid) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
$query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
})
->order('pay_time ASC')->select()->toArray();
->order('pay_time ASC,id DESC')->select()->toArray();
}

View File

@ -53,7 +53,7 @@ class ShippingTemplatesDao extends BaseDao
*/
public function getShippingList(array $where, int $page, int $limit)
{
return $this->search($where)->order('sort DESC')->page($page, $limit)->select()->toArray();
return $this->search($where)->order('sort DESC,id DESC')->page($page, $limit)->select()->toArray();
}
/**

View File

@ -128,7 +128,7 @@ class SystemMenusDao extends BaseDao
public function menusSelect(array $where, $type = 1)
{
if ($type == 1) {
return $this->search($where)->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
return $this->search($where)->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC,id DESC')->select();
} else {
return $this->search($where)->group('pid')->column('pid');
}
@ -143,7 +143,7 @@ class SystemMenusDao extends BaseDao
public function getSearchList()
{
return $this->search(['is_show' => 1, 'auth_type' => 1, 'is_del' => 0, 'is_show_path' => 0])
->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC,id DESC')->select();
}
/**

View File

@ -84,7 +84,7 @@ class SystemConfigDao extends BaseDao
{
$where['tab_id'] = $tabId;
if ($status == 1) $where['status'] = $status;
return $this->search($where)->order('sort desc')->select()->toArray();
return $this->search($where)->order('sort desc,id DESC')->select()->toArray();
}
/**

View File

@ -50,7 +50,7 @@ class MemberShipDao extends BaseDao
*/
public function getApiList(array $where)
{
return $this->search()->where($where)->order('sort desc')->select()->toArray();
return $this->search()->where($where)->order('sort desc,id DESC')->select()->toArray();
}

View File

@ -44,6 +44,6 @@ class UserAddressDao extends BaseDao
*/
public function getList(array $where, string $field = '*', int $page, int $limit): array
{
return $this->search($where)->field($field)->page($page, $limit)->order('is_default DESC')->select()->toArray();
return $this->search($where)->field($field)->page($page, $limit)->order('is_default DESC,id DESC')->select()->toArray();
}
}

View File

@ -45,7 +45,7 @@ class UserLabelCateDao extends BaseDao
{
return $this->search($where)->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->order('sort DESC')->select()->toArray();
})->order('sort DESC,id DESC')->select()->toArray();
}
/**
@ -59,6 +59,6 @@ class UserLabelCateDao extends BaseDao
{
return $this->getModel()->when(count($with), function ($query) use ($with) {
$query->with($with);
})->order('sort DESC')->select()->toArray();
})->order('sort DESC,id DESC')->select()->toArray();
}
}

View File

@ -69,10 +69,10 @@ class User extends BaseModel
return app('request')->ip();
}
protected function getPhoneAttr($value)
{
return $value && app('request')->hasMacro('adminInfo') && app('request')->adminInfo()['level'] != 0 ? substr_replace($value, '****', 3, 4) : $value;
}
// protected function getPhoneAttr($value)
// {
// return $value && app('request')->hasMacro('adminInfo') && app('request')->adminInfo()['level'] != 0 ? substr_replace($value, '****', 3, 4) : $value;
// }
/**
* 链接会员登陆设置表

View File

@ -96,7 +96,7 @@ class Express extends BaseExpress
'send_real_name' => $data['send_real_name'],
'send_phone' => $data['send_phone'],
'send_address' => $data['send_address'],
'call_back_url' => sys_config(''),
'call_back_url' => sys_config('site_url') . '/api/order_call_back',
'return_type' => $siid ? '10' : '20',
'siid' => $siid,
'tempid' => $data['tempid'],

View File

@ -139,7 +139,7 @@ class Cos extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -129,7 +129,7 @@ class Jdoss extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -116,7 +116,7 @@ class Local extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -59,7 +59,7 @@ class Obs extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -130,7 +130,7 @@ class Oss extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -126,7 +126,7 @@ class Qiniu extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -58,7 +58,7 @@ class Tyoss extends BaseUpload
return $this->setError('上传的文件不存在');
}
if ($this->validate) {
if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
return $this->setError('不合法的文件后缀');
}
if (filesize($fileHandle) > $this->validate['filesize']) {

View File

@ -137,7 +137,7 @@ export default {
};
},
created() {
this.onIsLogin();
// this.onIsLogin();
},
methods: {
onChangePhone() {