添加:支持通过二维码邀请员工

This commit is contained in:
wuhui_zzw 2024-01-23 11:39:40 +08:00
parent ad7eb11e9d
commit 1b175d86aa
4 changed files with 41 additions and 4 deletions

View File

@ -99,7 +99,7 @@ class StoreServiceRepository extends BaseRepository
$filed = [
"value" => 1,
"rule" => [
"status","customer","is_goods","is_verify","notify","is_user","staff_manage"
"status","customer","is_goods","is_verify","notify",'phone',"is_user","staff_manage",'qr_code_show'
]
];
$adminRule[] = Elm::number('sort', '排序', 0)->precision(0)->max(99999);

View File

@ -3,6 +3,7 @@
namespace app\controller\api\store\merchant;
use app\validate\merchant\StoreServiceValidate;
use crmeb\services\QrcodeService;
use think\App;
use crmeb\basic\BaseController;
use app\common\repositories\store\service\StoreServiceRepository;
@ -33,6 +34,38 @@ class Service extends BaseController{
return app('json')->success($data);
}
/**
* Common: 生成员工邀请二维码
* Author: wu-hui
* Time: 2024/01/23 10:08
* @return mixed
*/
public function inviteQrCode(){
// 参数获取
$merId = $this->request->param('mer_id');
if((int)$merId > 0){
try{
// 生成参数
$valueData = 'mer_id=' . $merId;
$path = 'pages/admin/business/edit_staff';// /pages/admin/business/edit_staff
$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('小程序码生成失败!');
}
/**
* Common: 编辑信息
* Author: wu-hui
@ -79,7 +112,8 @@ class Service extends BaseController{
'notify',
'avatar',
'phone',
['sort',0]
['sort',0],
'qr_code_show'
]);
if(is_array(json_decode($data['uid'], true))) $data['uid'] = json_decode($data['uid'], true);
// 是否编辑
@ -90,10 +124,11 @@ class Service extends BaseController{
}
$data['uid'] = $data['uid']['id'];
unset($data['confirm_pwd']);
return $data;
}
/**
* Common: 获取用户信息
* Common: 获取员工信息
* Author: wu-hui
* Time: 2024/01/22 18:34
* @return mixed

View File

@ -107,7 +107,8 @@ class StoreService extends BaseController
'notify',
'avatar',
'phone',
['sort',0]
['sort',0],
'qr_code_show'
]);
if ($isUpdate) {
$validate->update();

View File

@ -372,6 +372,7 @@ Route::group('api/', function () {
// 员工管理
Route::group('staff', function () {
Route::get('staff_list', 'Service/lst');// 列表
Route::get('staff_invite_qr_code', 'Service/inviteQrCode');// 员工邀请二维码
Route::get('staff_edit', 'Service/editInfo');// 编辑
Route::get('staff_del', 'Service/delInfo');// 删除
Route::get('staff_info', 'Service/staffInfo');// 删除