Merge branch 'main' of http://git.njrzwl.cn:3000/wangmingchuan/yanzong
commit
b0f58984c3
@ -0,0 +1,53 @@ |
||||
<?php |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\api\model\Server; |
||||
|
||||
use app\api\model\UploadFile; |
||||
use app\common\model\server\RecoveryCategory as BaseRecoveryCategory; |
||||
use think\db\exception\DataNotFoundException; |
||||
use think\db\exception\DbException; |
||||
use think\db\exception\ModelNotFoundException; |
||||
use think\model\relation\HasOne; |
||||
|
||||
class RecoveryCategory extends BaseRecoveryCategory |
||||
{ |
||||
/** |
||||
* 隐藏字段 |
||||
* @var array |
||||
*/ |
||||
protected $hidden = [ |
||||
'store_id', |
||||
'create_time', |
||||
'update_time', |
||||
'status', |
||||
'image_id', |
||||
]; |
||||
|
||||
/** |
||||
* 分类图片 |
||||
* @return HasOne |
||||
*/ |
||||
public function image(): HasOne |
||||
{ |
||||
return $this->hasOne(UploadFile::class, 'file_id', 'image_id') |
||||
->bind(['image_url' => 'preview_url']); |
||||
} |
||||
|
||||
/** |
||||
* @notes:获取全部记录 |
||||
* @return array |
||||
* @throws DataNotFoundException |
||||
* @throws DbException |
||||
* @throws ModelNotFoundException |
||||
* @author: wanghousheng |
||||
*/ |
||||
public function list(): array |
||||
{ |
||||
return $this->with(['image']) |
||||
->where(['status' => 1]) |
||||
->order(['sort', 'create_time']) |
||||
->select() |
||||
->toArray(); |
||||
} |
||||
} |
@ -0,0 +1,21 @@ |
||||
<?php |
||||
|
||||
namespace app\api\model\Server; |
||||
|
||||
use app\common\model\server\ServerRecovery as BaseServerRecovery; |
||||
|
||||
class ServerRecovery extends BaseServerRecovery |
||||
{ |
||||
/** |
||||
* 隐藏字段 |
||||
* @var array |
||||
*/ |
||||
protected $hidden = [ |
||||
'store_id', |
||||
'create_time', |
||||
'update_time', |
||||
'status', |
||||
'image_id', |
||||
'delete_time', |
||||
]; |
||||
} |
@ -0,0 +1,44 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\controller\user; |
||||
|
||||
use think\response\Json; |
||||
use app\store\controller\Controller; |
||||
use app\store\model\user\Feedback as FeedbackModel; |
||||
|
||||
/** |
||||
* 反馈 |
||||
* |
||||
* @package app\store\controller\user |
||||
*/ |
||||
class Feedback extends Controller |
||||
{ |
||||
//获取反馈列表 |
||||
public function getFeedBack(): Json |
||||
{ |
||||
$params = $this->request->param(); |
||||
$service = new FeedbackModel(); |
||||
$list = $service->getFeedback($params); |
||||
return $this->renderSuccess(compact('list')); |
||||
} |
||||
|
||||
public function replay(): Json |
||||
{ |
||||
$params = $this->request->param(); |
||||
$service = new FeedbackModel(); |
||||
if ($service->replyFeedback($params)) { |
||||
return $this->renderSuccess("回复成功"); |
||||
} |
||||
return $this->renderError($service->getError() ?? "回复失败"); |
||||
} |
||||
} |
@ -0,0 +1,34 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\controller\user; |
||||
|
||||
use think\response\Json; |
||||
use app\store\controller\Controller; |
||||
use app\store\model\user\GoodsSource as GoodsSourceModel; |
||||
|
||||
/** |
||||
* 反馈 |
||||
* |
||||
* @package app\store\controller\user |
||||
*/ |
||||
class GoodsSource extends Controller |
||||
{ |
||||
//获取列表 |
||||
public function getList(): Json |
||||
{ |
||||
$params = $this->request->param(); |
||||
$service = new GoodsSourceModel(); |
||||
$list = $service->getList($params); |
||||
return $this->renderSuccess(compact('list')); |
||||
} |
||||
} |
@ -0,0 +1,56 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\model\user; |
||||
|
||||
use app\common\model\UserFeedback as UserFeedbackModel; |
||||
use cores\exception\BaseException; |
||||
|
||||
/** |
||||
* 用户余额充值服务 |
||||
* Class Recharge |
||||
* @package app\api\controller |
||||
*/ |
||||
class Feedback extends UserFeedbackModel |
||||
{ |
||||
|
||||
//反馈列表 |
||||
public function getFeedback($params, $listRows = 10) |
||||
{ |
||||
$query = new UserFeedbackModel(); |
||||
if (!empty($params['user_id'])) { |
||||
$query = $query->where(['user_id' => $params['user_id']]); |
||||
} |
||||
$list = $query->with(['shop']) |
||||
->paginate($listRows)->toArray(); |
||||
foreach ($list['data'] as $k => $v) { |
||||
$list['data'][$k]['shop_name'] = !empty($v['shop']['shop_name']) ? $v['shop']['shop_name'] : ''; |
||||
unset($list['data'][$k]['shop']); |
||||
} |
||||
return $list; |
||||
} |
||||
|
||||
|
||||
public function replyFeedback(array $data) |
||||
{ |
||||
$model = self::get(['id' => $data['id']]); |
||||
if($model->status == 1){ |
||||
$this->error = '请勿重复回复'; |
||||
return false; |
||||
} |
||||
return $model->save([ |
||||
'replay' => $data['content'], |
||||
'status' => 1, |
||||
'replay_at' => time(), |
||||
]); |
||||
} |
||||
} |
@ -0,0 +1,49 @@ |
||||
<?php |
||||
// +---------------------------------------------------------------------- |
||||
// | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ] |
||||
// +---------------------------------------------------------------------- |
||||
// | Copyright (c) 2017~2023 https://www.yiovo.com All rights reserved. |
||||
// +---------------------------------------------------------------------- |
||||
// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 |
||||
// +---------------------------------------------------------------------- |
||||
// | Author: 萤火科技 <admin@yiovo.com> |
||||
// +---------------------------------------------------------------------- |
||||
declare (strict_types=1); |
||||
|
||||
namespace app\store\model\user; |
||||
|
||||
use app\common\model\user\GoodSource as GoodSourceModel; |
||||
use app\store\model\UploadFile; |
||||
use cores\exception\BaseException; |
||||
|
||||
/** |
||||
* 用户余额充值服务 |
||||
* Class Recharge |
||||
* @package app\api\controller |
||||
*/ |
||||
class GoodsSource extends GoodSourceModel |
||||
{ |
||||
|
||||
//反馈列表 |
||||
public function getList($params, $listRows = 10) |
||||
{ |
||||
$query = new GoodSourceModel(); |
||||
if (!empty($params['user_id'])) { |
||||
$query = $query->where(['user_id' => $params['user_id']]); |
||||
} |
||||
$list = $query->paginate($listRows)->toArray(); |
||||
foreach ($list['data'] as $k => $v) { |
||||
$img_data = []; |
||||
if(!empty($v['imgage_ids'])){ |
||||
$img_ids = json_decode($v['imgage_ids']); |
||||
$img = UploadFile::whereIn('file_id',$img_ids)->select()->toArray(); |
||||
foreach($img as $ik => $iv){ |
||||
$img_data[] = $iv['preview_url']; |
||||
} |
||||
} |
||||
$list['data'][$k]['imgs'] = $img_data; |
||||
} |
||||
return $list; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue