edit-api-post_cus

This commit is contained in:
lccsw
2022-11-22 16:44:16 +08:00
parent fa46f794b0
commit 2243de4922
2 changed files with 10 additions and 5 deletions
+3 -2
View File
@@ -244,8 +244,9 @@ class Customers extends Wxapp
if (!$city_id || !$county_id) {
throw new Exception('请选择城市与行政区', API_CODE_FAIL);
}
if ($this->customers_model->count(['biz_id' => $this->biz_id, 'mobile' => $mobile])) {
throw new Exception('客户已存在', API_CODE_FAIL);
$is_exit = $this->customers_model->get(['biz_id' => $this->biz_id, 'mobile' => $mobile],'id');
if ($is_exit) {
return ['code'=>API_CODE_FAIL,'msg'=>'客户已存在','data'=>['id'=>$is_exit['id']]];
}
$biz_row = $this->biz_model->get(['id' => $this->biz_id]);
$this->load->library('receiver/customers_entity');
+7 -3
View File
@@ -109,7 +109,8 @@ class Biz extends Admin {
$where = [
'kpi' => 'order',
"areaId" => $area_id,
'type' => 0
'type' => 0,
"activityId in (select activityId from lc_market_sylive_activity_biz where areaId={$area_id} and status=0)" => null
];
$count_order = $this->mdSytActivityKpiData->count($where);
$count = [
@@ -132,14 +133,17 @@ class Biz extends Admin {
$where = [
'status' => 0,
"activityId in (select activityId from lc_market_sylive_activity_biz where
areaId in (select organizationId from lc_market_sylive_organization where parentId={$this->session['org_id']} and status=0)
areaId in (select organizationId from lc_market_sylive_organization where parentId={$this->session['org_id']} and status=0) and status=0
)" => null
];
$count_live = $this->market_sylive_activity_model->count($where);
$where = [
'type' => 0,
'kpi' => 'order',
" areaId in (select organizationId from lc_market_sylive_organization where parentId={$this->session['org_id']} and status=0)" => null
"areaId in (select organizationId from lc_market_sylive_organization where parentId={$this->session['org_id']} and status=0)" => null,
"activityId in (select activityId from lc_market_sylive_activity_biz where
areaId in (select organizationId from lc_market_sylive_organization where parentId={$this->session['org_id']} and status=0) and status=0
)" => null
];
$count_order = $this->mdSytActivityKpiData->count($where);
$count = [