添加:支持员工生成推广二维码
This commit is contained in:
parent
1b175d86aa
commit
647e1601de
|
|
@ -6,6 +6,7 @@ namespace app\controller\api\store\merchant;
|
|||
|
||||
use app\common\repositories\store\service\StoreServiceRepository;
|
||||
use app\common\repositories\user\UserMerchantRepository;
|
||||
use crmeb\services\QrcodeService;
|
||||
use think\App;
|
||||
use crmeb\basic\BaseController;
|
||||
use app\common\repositories\system\merchant\MerchantRepository as repository;
|
||||
|
|
@ -26,7 +27,6 @@ class Merchant extends BaseController
|
|||
$this->repository = $repository;
|
||||
$this->userInfo =$this->request->isLogin() ? $this->request->userInfo():null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/27
|
||||
|
|
@ -38,7 +38,6 @@ class Merchant extends BaseController
|
|||
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader']);
|
||||
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/29
|
||||
|
|
@ -55,7 +54,6 @@ class Merchant extends BaseController
|
|||
}
|
||||
return app('json')->success($this->repository->detail($id, $this->userInfo));
|
||||
}
|
||||
|
||||
public function systemDetail()
|
||||
{
|
||||
$config = systemConfig(['site_logo', 'site_name','login_logo']);
|
||||
|
|
@ -68,9 +66,6 @@ class Merchant extends BaseController
|
|||
'service_score' => '5.0',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/29
|
||||
|
|
@ -84,7 +79,6 @@ class Merchant extends BaseController
|
|||
if(!$this->repository->apiGetOne($id)) return app('json')->fail(' 店铺已打烊');
|
||||
return app('json')->success($this->repository->productList($id,$where, $page, $limit,$this->userInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/29
|
||||
|
|
@ -97,7 +91,6 @@ class Merchant extends BaseController
|
|||
return app('json')->fail('店铺已打烊');
|
||||
return app('json')->success($this->repository->categoryList($id));
|
||||
}
|
||||
|
||||
public function qrcode($id)
|
||||
{
|
||||
if(!$this->repository->merExists($id))
|
||||
|
|
@ -105,7 +98,6 @@ class Merchant extends BaseController
|
|||
$url = $this->request->param('type') == 'routine' ? $this->repository->routineQrcode(intval($id)) : $this->repository->wxQrcode(intval($id));
|
||||
return app('json')->success(compact('url'));
|
||||
}
|
||||
|
||||
public function localLst()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
|
|
@ -114,4 +106,38 @@ class Merchant extends BaseController
|
|||
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* Common: 员工推广二维码
|
||||
* Author: wu-hui
|
||||
* Time: 2024/01/23 11:54
|
||||
* @return mixed
|
||||
*/
|
||||
public function promoteQrCode(){
|
||||
// 参数获取
|
||||
$merId = $this->request->param('mer_id');
|
||||
if((int)$merId > 0){
|
||||
try{
|
||||
// 生成参数
|
||||
$valueData = 'mer_id=' . $merId;
|
||||
$path = 'pages/annex/vip_center/index';
|
||||
$name = md5($path . $valueData) . '.jpg';
|
||||
$qrcode = app()->make(QrcodeService::class)->getRoutineQrcodePath($name, $path, $valueData);
|
||||
if (!$qrcode) throw new \Exception('二维码生成失败');
|
||||
|
||||
return app('json')->success([
|
||||
'qr_code' => $qrcode
|
||||
]);
|
||||
}catch(\Exception $e){
|
||||
return app('json')->fail($e->getMessage());
|
||||
}catch(\Throwable $e){
|
||||
return app('json')->fail($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return app('json')->fail('小程序码生成失败!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -376,12 +376,16 @@ Route::group('api/', function () {
|
|||
Route::get('staff_edit', 'Service/editInfo');// 编辑
|
||||
Route::get('staff_del', 'Service/delInfo');// 删除
|
||||
Route::get('staff_info', 'Service/staffInfo');// 删除
|
||||
})->prefix('api.store.merchant.');
|
||||
// 移动端商户管理
|
||||
Route::group('merchant', function () {
|
||||
Route::get('promote_qr_code', 'Merchant/promoteQrCode');// 推广二维码
|
||||
|
||||
|
||||
|
||||
})->prefix('api.store.merchant.');
|
||||
|
||||
|
||||
|
||||
|
||||
})->middleware(UserTokenMiddleware::class, true);
|
||||
//非强制登录
|
||||
Route::group(function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue