transfer_104
This commit is contained in:
@@ -659,6 +659,10 @@ class Transfer extends HD_Controller
|
||||
}
|
||||
}
|
||||
$jsondata['abnormal']['imgs'] = $abnor_imgs;
|
||||
$set_abnormal = 0;
|
||||
if ($jsondata['abnormal']['note'] || $jsondata['abnormal']['imgs']) {//有异常内容或图片
|
||||
$set_abnormal = 1;
|
||||
}
|
||||
//运输单号
|
||||
$tran_imgs = '';
|
||||
if ($transport['imgs']) {
|
||||
@@ -669,7 +673,7 @@ class Transfer extends HD_Controller
|
||||
$transport_json = $jsondata['transport'] ? $jsondata['transport'] : [];
|
||||
$transport_json['imgs'] = $tran_imgs;
|
||||
$jsondata['transport'] = $transport_json;
|
||||
$this->mdTransfer->update(['abnormal' => 1, 'jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)], ['id' => $tran_id]);
|
||||
$this->mdTransfer->update(['abnormal' => $set_abnormal, 'jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)], ['id' => $tran_id]);
|
||||
$ret = '';
|
||||
if ($opt_btn['type'] == 1) {//确认发车
|
||||
$ret = $this->mdTransferAdmin->update(['status' => 2], ['tran_id' => $tran_id, 'type in(1,2)' => null]);//信息员已完成
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-inline" v-if="opt_btn.type">
|
||||
<div class="am-form-inline" v-if="opt_btn.type" style="margin-top: 8px;">
|
||||
<textarea v-if="opt_btn.type" rows="5" style="width: 50%" v-model="abnormal.note"
|
||||
placeholder="请填写异常备注"></textarea>
|
||||
</div>
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
<option :value="v.id" v-for="(v,i) in takeCar1.cityList">{{v.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="am-para-inline w170" v-if="info.fees_type==1">
|
||||
<div class="am-para-inline w180" v-if="info.fees_type==1">
|
||||
<select v-model="info.fees_biz_id">
|
||||
<option value="">选择门店</option>
|
||||
<option :value="v.id" v-for="(v,i) in showInfo.feesBizList">{{v.name}}</option>
|
||||
|
||||
@@ -18,6 +18,29 @@ class Licheb extends HD_Controller
|
||||
$this->load->model('receiver/receiver_customers_visit_model', 'mdCustomersVisit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:更新车辆调拨异常
|
||||
* Created on: 2022/1/4 13:53
|
||||
* Created by: dengbw
|
||||
* https://liche-api-dev.xiaoyu.com/plan/licheb/transfer_abnormal
|
||||
* https://api.liche.cn/plan/licheb/transfer_abnormal
|
||||
*/
|
||||
public function transfer_abnormal()
|
||||
{
|
||||
$this->load->model('items/items_transfer_model', 'mdTransfer');
|
||||
$params = $this->input->get();
|
||||
$ret = '';
|
||||
if ($params['id']) {
|
||||
$abnormal = intval($params['abnormal']);
|
||||
$ret = $this->mdTransfer->update(['abnormal' => $abnormal], ['id' => $params['id']]);
|
||||
}
|
||||
if ($ret) {
|
||||
echo "更新异常成功_{$params['id']}_$abnormal";
|
||||
} else {
|
||||
echo "更新异常失败";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:给销售发送待回访短信
|
||||
* Created on: 2021/10/19 17:15
|
||||
|
||||
@@ -52,22 +52,54 @@ class Biz extends Wxapp
|
||||
$re_base = $this->mdBizBase->get(['biz_id' => $biz_id]);
|
||||
$fields = $this->mdBizBase->get_fields();
|
||||
foreach ($fields as $key => $value) {
|
||||
$list = '';
|
||||
if ($key == 'county' && $re_biz['city_id']) {//县区
|
||||
$result = $this->area_model->county($re_biz['city_id'], 1);
|
||||
$fields[$key]['list'] = array_merge($value['list'], $result);
|
||||
$list[] = $value['list'];
|
||||
$result = $this->area(['type' => $key, 'id' => $re_biz['city_id']]);
|
||||
foreach ($result as $key2 => $value2) {
|
||||
$list[] = $value2;
|
||||
}
|
||||
$fields[$key]['list'] = $list;
|
||||
$re_biz['county_id'] && $fields[$key]['value'] = $re_biz['county_id'];
|
||||
} else if ($key == 'street' && $re_biz['county_id']) {//乡镇
|
||||
$result = [];
|
||||
$list = $this->mdStreet->select(['county_id' => $re_biz['county_id']], 'id ASC', 0, 0, 'street_id,street_name');
|
||||
foreach ($list as $v) {
|
||||
$result[$v['street_id']] = array('id' => $v['street_id'], 'name' => $v['street_name']);
|
||||
$list[] = $value['list'];
|
||||
$result = $this->area(['type' => $key, 'id' => $re_biz['county_id']]);
|
||||
foreach ($result as $key2 => $value2) {
|
||||
$list[] = $value2;
|
||||
}
|
||||
$fields[$key]['list'] = array_merge($value['list'], $result);
|
||||
$fields[$key]['list'] = $list;
|
||||
$re_biz['street_id'] && $fields[$key]['value'] = $re_biz['street_id'];
|
||||
} else if ($key == 'type' && $re_biz['type']) {//类型
|
||||
$list[] = $value['list'];
|
||||
foreach ($this->mdBiz->type_ary() as $key2 => $value2) {
|
||||
$list[] = ['id' => $key2, 'name' => $value2];
|
||||
}
|
||||
$fields[$key]['list'] = $list;
|
||||
$fields[$key]['value'] = $re_biz['type'];
|
||||
} else if ($key == 'level') {//级别
|
||||
$fields[$key]['value'] = $this->level($biz_id);
|
||||
} else if ($key == 'lead') {//负责人
|
||||
$list[] = $value['list'];
|
||||
$result = $this->app_user_model->select(['biz_id' => $biz_id], 'id DESC', 0, 0, 'id,uname as name');
|
||||
foreach ($result as $key2 => $value2) {
|
||||
$list[] = $value2;
|
||||
}
|
||||
$fields[$key]['list'] = $list;
|
||||
$re_base[$key] && $fields[$key]['value'] = $re_base[$key];
|
||||
} else if ($key == 'imgs') {//负责人
|
||||
$imgs = $re_base[$key] ? $re_base[$key] : [];
|
||||
foreach ($fields[$key]['list'] as $key2 => $value2) {
|
||||
$setValue = $value2;
|
||||
if ($imgs[$value2['id']]) {
|
||||
$setValue['value'] = $imgs[$value2['id']];
|
||||
$setValue['scr'] = build_qiniu_image_url($setValue['value']);
|
||||
} else {
|
||||
$setValue['value'] = '';
|
||||
$setValue['scr'] = '';
|
||||
}
|
||||
$list[] = $setValue;
|
||||
}
|
||||
$fields[$key]['list'] = $list;
|
||||
} else if ($re_base && $re_base[$key]) {//有字段赋值
|
||||
$fields[$key]['value'] = $re_base[$key];
|
||||
}
|
||||
@@ -79,15 +111,50 @@ class Biz extends Wxapp
|
||||
return $info;
|
||||
}
|
||||
|
||||
public function get_area()
|
||||
{
|
||||
$type = $this->input->get('type');
|
||||
$id = intval($this->input->get('id'));
|
||||
return $this->area(['type' => $type, 'id' => $id]);
|
||||
}
|
||||
|
||||
public function area($params)
|
||||
{
|
||||
$result = [];
|
||||
if ($params['id']) {
|
||||
if ($params['type'] == 'county') {
|
||||
$result = $this->area_model->county($params['id'], 1);
|
||||
} else if ($params['type'] == 'street') {
|
||||
$result = $this->mdStreet->select(['county_id' => $params['id']], 'id ASC', 0, 0, 'street_id as id,street_name as name');
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:报备异常
|
||||
* Created on: 2021/12/10 16:07
|
||||
* Created by: dengbw
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function post()
|
||||
{
|
||||
$id = intval($this->input_param('id'));
|
||||
$info = $this->input_param('info');
|
||||
if (!$id || !$info) {
|
||||
throw new Exception('参数错误', ERR_PARAMS_ERROR);
|
||||
}
|
||||
$biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
|
||||
if ($id == 1) {//售卖情况
|
||||
} else {//基础信息
|
||||
$date = [];
|
||||
$fields = $this->mdBizBase->get_fields();
|
||||
foreach ($fields as $key => $value) {
|
||||
if ($info[$key]) {
|
||||
$date[$key] = $value;
|
||||
}
|
||||
}
|
||||
$re_base = $this->mdBizBase->get(['biz_id' => $biz_id]);
|
||||
if (!$re_base) {//更新
|
||||
$date['biz_id'] = $biz_id;
|
||||
} else {//新增
|
||||
}
|
||||
}
|
||||
throw new Exception('保存成功', API_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
private function level($biz_id = 0)
|
||||
@@ -113,7 +180,7 @@ class Biz extends Wxapp
|
||||
} else if ($orders >= 3) {
|
||||
$str = 'B3';
|
||||
} else {
|
||||
$month_s = date("Y-m-01", strtotime("-3 month")); //上3月1日
|
||||
$month_s = date("Y-m-01", strtotime("-3 month")); //上3个月1日
|
||||
$month_e = date("Y-m-d", strtotime("$month_s +1 month -1 day")); //上3个月最后一天
|
||||
$orders = $this->mdOrders->count(array_merge($where, ['c_time >=' => strtotime($month_s . ' 00:00:00')
|
||||
, 'c_time <=' => strtotime($month_e . ' 23:59:59')]));
|
||||
@@ -136,4 +203,5 @@ class Biz extends Wxapp
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ class Topic extends Wxapp
|
||||
$this->load->model('app/material/Material_template_model', 'mdTemplate');
|
||||
$this->load->model('app/material/Material_biz_model', 'mdMaterialBiz');
|
||||
$this->load->model('app/material/Material_biz_statistics_model', 'mdBizStatistics');
|
||||
$this->app_id == 1 && $this->app_id = 2;//获取狸车宝数据
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,6 +35,7 @@ class Topic extends Wxapp
|
||||
*/
|
||||
protected function get()
|
||||
{
|
||||
$this->app_id == 1 && $this->app_id = 2;//获取狸车宝数据
|
||||
$id = intval($this->input_param('id'));
|
||||
$biz_id = intval($this->input_param('biz_id'));
|
||||
$re = $this->mdTemplate->get(array('id' => $id, 'status' => 1));
|
||||
|
||||
@@ -18,17 +18,17 @@ class Biz_base_model extends HD_Model
|
||||
public function get_fields()
|
||||
{
|
||||
$field['company'] = ['title' => '公司名称', 'type' => 'input', 'input_type' => 'text', 'value' => ''];
|
||||
$field['county'] = ['title' => '县区', 'type' => 'select', 'list' => [0 => '选择县区'], 'value' => ''];
|
||||
$field['street'] = ['title' => '乡镇', 'type' => 'select', 'list' => [0 => '选择乡镇'], 'value' => ''];
|
||||
$field['type'] = ['title' => '类型', 'type' => 'select', 'list' => [0 => '选择类型', 1 => '品牌店', 2 => '形象店'
|
||||
, 3 => '代理店', 4 => '合作店'], 'value' => ''];
|
||||
$field['county'] = ['title' => '县区', 'type' => 'select', 'list' => ['id' => 0, 'name' => '选择县区'], 'value' => ''];
|
||||
$field['street'] = ['title' => '乡镇', 'type' => 'select', 'list' => ['id' => 0, 'name' => '选择乡镇'], 'value' => ''];
|
||||
$field['type'] = ['title' => '类型', 'type' => 'select', 'list' => ['id' => 0, 'name' => '选择类型'], 'value' => ''];
|
||||
$field['level'] = ['title' => '级别', 'type' => 'text', 'value' => ''];
|
||||
$field['lead'] = ['title' => '负责人', 'type' => 'select', 'list' => [0 => '选择负责人'], 'value' => ''];
|
||||
$field['lead'] = ['title' => '负责人', 'type' => 'select', 'list' => ['id' => 0, 'name' => '选择负责人'], 'value' => ''];
|
||||
$field['douyin'] = ['title' => '抖音号', 'type' => 'input', 'input_type' => 'text', 'value' => ''];
|
||||
$field['address'] = ['title' => '位置', 'type' => 'input', 'input_type' => 'text', 'value' => ''];
|
||||
$field['area'] = ['title' => '面积', 'type' => 'input', 'input_type' => 'int', 'value' => ''];
|
||||
$field['rent'] = ['title' => '租金/月', 'type' => 'input', 'input_type' => 'int', 'value' => ''];
|
||||
$field['imgs'] = ['title' => '门店照片', 'type' => 'img', 'value' => ''];
|
||||
$field['imgs'] = ['title' => '门店照片', 'type' => 'img', 'list' => [['id' => 1, 'name' => '远景']
|
||||
, ['id' => 2, 'name' => '门头'], ['id' => 3, 'name' => '内景']], 'value' => ''];
|
||||
return $field;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user