客户标签
This commit is contained in:
@@ -17,7 +17,7 @@ class TagGroupController extends BaseController
|
||||
{
|
||||
$list = TagGroup::with('tags')->get();
|
||||
$languageArr = Constants::LANGUAGE;
|
||||
$language = $request->user['language'];
|
||||
$language = 'zh_CN';
|
||||
foreach ($list as &$item) {
|
||||
$item['names'] = unserialize($item['names']);
|
||||
if (in_array($language, $languageArr)) {
|
||||
@@ -52,10 +52,15 @@ class TagGroupController extends BaseController
|
||||
return $this->error( trans('tag_group_id') . trans('not_null'));
|
||||
}
|
||||
|
||||
if(empty($tagId)){
|
||||
$res = CustomerTag::where(['customer_id' => $customerId, 'group_id' => $groupId])->delete();
|
||||
}else{
|
||||
$res = CustomerTag::updateOrCreate(['customer_id' => $customerId, 'group_id' => $groupId], ['tag_id' => $tagId]);
|
||||
|
||||
try {
|
||||
if(empty($tagId)){
|
||||
$res = CustomerTag::where(['customer_id' => $customerId, 'group_id' => $groupId])->delete();
|
||||
}else{
|
||||
$res = CustomerTag::updateOrCreate(['customer_id' => $customerId, 'group_id' => $groupId], ['tag_id' => $tagId]);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
|
||||
if($res){
|
||||
|
||||
@@ -104,5 +104,8 @@ Route::group('/crm', function () {
|
||||
Route::any('/customer/statistics', [app\crm\controller\CustomerController::class, 'statistics']);
|
||||
Route::any('/customer/getChannel', [app\crm\controller\CustomerController::class, 'getChannel']);
|
||||
Route::any('/customer/getCountry', [app\crm\controller\CustomerController::class, 'getCountry']);
|
||||
|
||||
Route::any('/tagGroup/list', [app\crm\controller\TagGroupController::class, 'list']);
|
||||
Route::any('/tagGroup/updatePivot', [app\crm\controller\TagGroupController::class, 'updatePivot']);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user