修改评分
This commit is contained in:
@@ -40,7 +40,15 @@ class Score extends Wxapp
|
||||
if (!$show_biz) {//查看个人
|
||||
$where['uid'] = $uid;
|
||||
}
|
||||
if ($day_type) { //上月
|
||||
if ($day_type == 1) { //上月
|
||||
$up_month = strtotime("-1 month"); //上个月时间
|
||||
$where['year'] = date('Y', $up_month);
|
||||
$where['month'] = date('m', $up_month);
|
||||
$where['type'] = $type ? Receiver_score_month_model::TYPE_BIZ : Receiver_score_month_model::TYPE_USER;
|
||||
$row = $this->receiver_score_month_model->get($where);
|
||||
$up_time = date('Y-m-01', time());
|
||||
$title_hd = '较本月';
|
||||
} elseif ($day_type == 2) {
|
||||
$up_month = strtotime("-1 month"); //上个月时间
|
||||
$where['year'] = date('Y', $up_month);
|
||||
$where['month'] = date('m', $up_month);
|
||||
@@ -84,6 +92,9 @@ class Score extends Wxapp
|
||||
if ($key > 0) {
|
||||
$operator = $scoreSum['operator'] >= 0 ? '+' : '-';
|
||||
}
|
||||
if ($key == Receiver_score_config_model::TYPE_DEDUCT) {
|
||||
$operator = '-';
|
||||
}
|
||||
$score_list[] = [
|
||||
'name' => $item['name'],
|
||||
'value' => $scoreSum['score'] ? abs(ceil($scoreSum['score'])) : 0,
|
||||
@@ -122,9 +133,11 @@ class Score extends Wxapp
|
||||
public function get_lists()
|
||||
{
|
||||
$type = $this->input_param('type'); // 默认0店内排行 1门店排行
|
||||
$day_type = $this->input_param('day_type'); // 默认0昨天 1上月
|
||||
$day_type = $this->input_param('day_type'); // 默认0昨天 1本月 2上月
|
||||
$limit = $type ? 100 : 10;
|
||||
if ($day_type) {
|
||||
if ($day_type == 1) {
|
||||
$result = Receiver_score_month_model::getTopLists($type, $this->biz_id, $limit);
|
||||
} elseif ($day_type == 2) {
|
||||
$result = Receiver_score_month_model::getTopLists($type, $this->biz_id, $limit);
|
||||
} else {
|
||||
$result = Receiver_score_day_model::getTopLists($type, $this->biz_id, $limit);
|
||||
@@ -207,19 +220,19 @@ class Score extends Wxapp
|
||||
case 0:
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
'province_id' => $province_id,
|
||||
"biz_id in (biz_id in (select id from lc_biz where province_id =$province_id))" => null,
|
||||
'c_time >=' => $s_stime,
|
||||
'c_time <=' => $s_etime,
|
||||
];
|
||||
$max = $this->customers_model->count($where);
|
||||
$max && $indicator[$key]['max'] = $max;
|
||||
$where["biz_id in (select id from lc_biz where province_id =$province_id)"] = null;
|
||||
$where['biz_id'] = $this->biz_id;
|
||||
$value = $this->customers_model->count($where);
|
||||
break;
|
||||
case 1://跟进能力
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
'province_id' => $province_id,
|
||||
"biz_id in (select id from lc_biz where province_id =$province_id)" => null,
|
||||
'c_time >=' => strtotime($s_time),
|
||||
'c_time <=' => strtotime($e_time),
|
||||
"id in (select DISTINCT customer_id from lc_receiver_customer_oplogs where c_time>={$s_stime} and c_time>={$s_etime})" => null
|
||||
@@ -231,12 +244,12 @@ class Score extends Wxapp
|
||||
'c_time >=' => strtotime($s_time),
|
||||
'c_time <=' => strtotime($e_time),
|
||||
"id in (select DISTINCT customer_id from lc_receiver_customer_oplogs where c_time>={$s_stime} and c_time>={$s_etime})" => null,
|
||||
"biz_id in (select id from lc_biz where province_id =$province_id)" => null
|
||||
"biz_id" => $this->biz_id
|
||||
];
|
||||
$biz_gj = $this->customers_model->count($where);
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
'province_id' => $province_id,
|
||||
"biz_id in (select id from lc_biz where province_id =$province_id)" => null,
|
||||
'c_time >=' => strtotime($s_time),
|
||||
'c_time <=' => strtotime($e_time),
|
||||
"status in (0,1)" => null
|
||||
@@ -244,7 +257,6 @@ class Score extends Wxapp
|
||||
$province_total = $this->customers_model->count($where);
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
'province_id' => $province_id,
|
||||
'c_time >=' => strtotime($s_time),
|
||||
'c_time <=' => strtotime($e_time),
|
||||
"status in (0,1)" => null,
|
||||
@@ -260,19 +272,19 @@ class Score extends Wxapp
|
||||
case 2:
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
'province_id' => $province_id,
|
||||
"biz_id in (select id from lc_biz where province_id =$province_id)" => null,
|
||||
'dt_time >=' => $s_time,
|
||||
'dt_time <=' => $e_time,
|
||||
];
|
||||
$max = $this->customers_model->count($where);
|
||||
$max && $indicator[$key]['max'] = $max;
|
||||
$where["biz_id in (select id from lc_biz where province_id =$province_id)"] = null;
|
||||
$where["biz_id"] = $this->biz_id;
|
||||
$value = $this->customers_model->count($where);
|
||||
break;
|
||||
case 3:
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
'province_id' => $province_id,
|
||||
'biz_id in (select id from lc_biz where province_id =$province_id)' => null,
|
||||
'c_time >=' => $s_stime,
|
||||
'c_time <=' => $s_etime,
|
||||
];
|
||||
@@ -281,7 +293,7 @@ class Score extends Wxapp
|
||||
$sub_sql = "select id from lc_receiver_customers where province_id={$province_id} and biz_id={$this->biz_id} and c_time>={$s_stime} and c_time>={$s_etime}";
|
||||
$where = [
|
||||
'status>=' => 0,
|
||||
"biz_id in (select id from lc_biz where province_id =$province_id)" => null,
|
||||
"biz_id" => $this->biz_id,
|
||||
'c_time >=' => strtotime($s_time),
|
||||
'c_time <=' => strtotime($e_time),
|
||||
"customer_id in ($sub_sql)" => null
|
||||
|
||||
Reference in New Issue
Block a user