zengyyh 4 months ago
parent 4369bea2d4
commit 2aadae8ef7
  1. 2
      app/admin/controller/RetailDescribe.php
  2. 52
      app/api/controller/Retail.php
  3. 42
      app/common/enum/RetailDescribeEnum.php
  4. 52
      app/common/model/MerchantRemarks.php
  5. 78
      app/store/controller/order/Event.php

@ -25,7 +25,7 @@ class RetailDescribe extends Controller
public function add(){ public function add(){
$model = new retDescribeModel; $model = new retDescribeModel;
if($model->add($this->postData())){ if($model->add($this->postForm())){
return $this->renderSuccess('添加成功'); return $this->renderSuccess('添加成功');
} }
return $this->renderError($model->getError() ?: '添加失败'); return $this->renderError($model->getError() ?: '添加失败');

@ -18,6 +18,7 @@ use app\api\model\Agreement as AgreementModel;
use app\common\model\RetailDescribe as RetailDescribeModel; use app\common\model\RetailDescribe as RetailDescribeModel;
use app\api\service\order\Checkout as CheckoutService; use app\api\service\order\Checkout as CheckoutService;
use app\api\service\User as UserService; use app\api\service\User as UserService;
use app\common\enum\RetailDescribeEnum;
class Retail extends Controller class Retail extends Controller
{ {
@ -64,27 +65,27 @@ class Retail extends Controller
} }
$model =new \app\api\service\Retail(); $model =new \app\api\service\Retail();
$list = $model->userCenter($client); $list = $model->userCenter($client);
$list['retail'] = '开通零售商城的10大优势\n $list['retail'] = '开通零售商城的10大优势/n
1-客户直接在商城查看价格,快速比价、下单\n 1-客户直接在商城查看价格,快速比价、下单/n
2-所有会员、分销数字化管理\n 2-所有会员、分销数字化管理/n
3-所有订单,调货记录,物流状态实时查询\n 3-所有订单,调货记录,物流状态实时查询/n
4-供应链资源快速对接\n 4-供应链资源快速对接/n
5-商品数据快速上架,商城之间数据实时传输\n 5-商品数据快速上架,商城之间数据实时传输/n
6-商品市场价实时自动更新\n 6-商品市场价实时自动更新/n
7-货款到账时间支持当天或隔天,支付费率低至千分之2.x\n 7-货款到账时间支持当天或隔天,支付费率低至千分之2.x/n
8-支持到店自提、同城闪送\n 8-支持到店自提、同城闪送/n
9-促进清洗、安装、维修、回收、租赁服务与产品销售一体化\n 9-促进清洗、安装、维修、回收、租赁服务与产品销售一体化/n
10-促进本地商家联盟数字化平台化发展'; 10-促进本地商家联盟数字化平台化发展';
$list['wholesale'] = '开通批发商城的10大优势\n $list['wholesale'] = '开通批发商城的10大优势/n
1-采购代发商家实名注册认证,在线直接下单\n 1-采购代发商家实名注册认证,在线直接下单/n
2-认证商家、服务商数字化管理\n 2-认证商家、服务商数字化管理/n
3-所有订单,发货记录,物流状态实时查询\n 3-所有订单,发货记录,物流状态实时查询/n
4-所有调货记录在线实时查看\n 4-所有调货记录在线实时查看/n
5-审单实时做电话、地址校验比对,避免平台单\n 5-审单实时做电话、地址校验比对,避免平台单/n
6-供应链资源快速对接\n 6-供应链资源快速对接/n
7-商品数据快速上架,商城之间商品数据实时传输\n 7-商品数据快速上架,商城之间商品数据实时传输/n
8-商品市场价实时自动更新\n 8-商品市场价实时自动更新/n
9-货款到账时间支持当天或隔天,支付费率低至千分之2.x\n 9-货款到账时间支持当天或隔天,支付费率低至千分之2.x/n
10-供应商、服务商入驻,销售和推广效益提升'; 10-供应商、服务商入驻,销售和推广效益提升';
return $this->renderSuccess(compact('list')); return $this->renderSuccess(compact('list'));
} }
@ -115,9 +116,16 @@ class Retail extends Controller
* 商厂权限 * 商厂权限
*/ */
public function describe() public function describe()
{ $type = $this->request->get('type')??10; {
$type = $this->request->get('type')??10;
$list = RetailDescribeModel::withoutGlobalScope()->where(['description_status' =>10,'type' => $type])->select(); $list = RetailDescribeModel::withoutGlobalScope()->where(['description_status' =>10,'type' => $type])->select();
return $this->renderSuccess(compact('list')); $group = [];
foreach($list as $item){
$group[$item['plate_id']]['list'][] = $item;
$group[$item['plate_id']]['name'] = RetailDescribeEnum::$version[$item['plate_id']] ?? "" ;
}
return $this->renderSuccess(compact('group'));
} }

@ -0,0 +1,42 @@
<?php
declare (strict_types=1);
namespace app\common\enum;
class RetailDescribeEnum extends EnumBasics
{
const GOODS = 1;
const DATA = 2;
const PRODUCT_ORDER = 3;
const SERVICE_ORDER = 4;
const RECYCLE_ORDER = 5;
const PAYMENT = 6;
const FINANCE = 7;
const STORE_DISPLAY = 8;
const ROLE = 9;
const MARKETING = 10;
const MULTI_MERCHANT = 11;
const CONTENT_MANAGEMENT = 12;
const OTHER_FEATURES = 13;
public static $version = [
self::GOODS => "商品",
self::DATA => "数据",
self::PRODUCT_ORDER => "商品订单",
self::SERVICE_ORDER => "服务订单",
self::RECYCLE_ORDER => "回收订单",
self::PAYMENT => "支付",
self::FINANCE => "财务",
self::STORE_DISPLAY => "店铺展示",
self::ROLE => "角色",
self::MARKETING => "营销",
self::MULTI_MERCHANT => "多商户",
self::CONTENT_MANAGEMENT => "内容管理",
self::OTHER_FEATURES => "其他功能",
];
private function __construct() {
} // 防止实例化
}

@ -0,0 +1,52 @@
<?php
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace app\common\model;
use cores\BaseModel;
class MerchantRemarks extends BaseModel
{
// 定义表名
protected $name = 'merchant_remarks';
// 定义主键
protected $pk = 'id';
// 定义时间戳字段名
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
public function add($data){
return self::save($data);
}
public function orderDetail($orderId){
return $this->where('order_id',$orderId)->order('create_time asc')->select();
}
public static function detail($MerchantRemarkId)
{
return self::get($MerchantRemarkId);
}
public function setRemarks($data){
return $this->save($data);
}
public function setDelete($MerchantRemarkId){
return $this->where('id', $MerchantRemarkId)->delete();
}
}

@ -15,6 +15,9 @@ namespace app\store\controller\order;
use think\response\Json; use think\response\Json;
use app\store\controller\Controller; use app\store\controller\Controller;
use app\store\model\Order as OrderModel; use app\store\model\Order as OrderModel;
use app\common\model\MerchantRemarks as MerchantRemarksModel;
use app\common\service\store\User as StoreUserService;
use app\common\model\UploadFile;
/** /**
* 订单事件控制器 * 订单事件控制器
@ -114,4 +117,79 @@ class Event extends Controller
} }
return $this->renderError($model->getError() ?: '操作失败'); return $this->renderError($model->getError() ?: '操作失败');
} }
/**
* 添加商家备注
* @param int $orderId
*/
public function addRemark(int $orderId): Json
{
$data = $this->postForm();
$data['store_id'] = $this->store['store_id'];
$storeUser = StoreUserService::getLoginInfo();
$data['user_id'] = $storeUser['user']['store_user_id'];
$data['order_id'] = $orderId;
$model = new MerchantRemarksModel;
if(isset($data['image_id']) && !empty($data['image_id'])){
$image_ids = $data['image_id'];
$image = array(
"image_id" => $image_ids
);
$data['image_id'] = json_encode($image);
}
if ($model->add($data)) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
/**
* 查看商家备注
* @param int $orderId
* @return Json
*/
public function getRemark(int $orderId): Json
{
$model = new MerchantRemarksModel;
// 备注详情
$list = $model->orderDetail($orderId);
if($list){
foreach($list as $key => $value){
if(isset($value['image_id']) && !empty($value['image_id']))
$value['image_id'] = json_decode($value['image_id'],true);
$value['image_id'] = $value['image_id']['image_id'];
$value['image_url'] = UploadFile::getFileList($value['image_id']);
}
}
return $this->renderSuccess(compact('list'));
}
/**
* 修改商家备注
* @param int $MerchantRemarkId
* @return Json
*/
public function modifyRemark(int $MerchantRemarkId): Json
{
// 订单详情
$model = MerchantRemarksModel::detail($MerchantRemarkId);
// 确认核销
if ($model->setRemarks($this->postForm())) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
public function deleteRemark(int $MerchantRemarkId): Json
{
// 确认核销
if ($model->setDelete($MerchantRemarkId)) {
return $this->renderSuccess('删除成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
} }

Loading…
Cancel
Save