门店增加类型

This commit is contained in:
lcc
2025-01-19 16:54:44 +08:00
parent ad6e27f8dd
commit 72e77c37e3
3 changed files with 26 additions and 14 deletions
+3 -1
View File
@@ -64,7 +64,7 @@ class Store extends HD_Controller
$c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00');
$c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59');
}
$typeAry = $this->biz_model->type_ary();
$biz_lists = $this->biz_model->select($where, 'id desc', $page, $pagesize);
$count = $this->biz_model->count($where);
$bizlists = [];
@@ -74,6 +74,7 @@ class Store extends HD_Controller
}
$this->data['params'] = $params;
$this->data['lists'] = $bizlists;
$this->data['typeAry'] = $typeAry;
$this->data['_title'] = '门店列表';
$this->data['pager'] = array('count' => ceil($count / $pagesize), 'curr' => $page, 'totle' => $count);
$this->show_view('biz/store/lists', true);
@@ -82,6 +83,7 @@ class Store extends HD_Controller
public function get()
{
$id = intval($this->input->get('id'));
$this->data['typeAry'] = $this->biz_model->type_ary();
$this->data['provinces'] = $this->province_ary();
if ($id) {
$biz = $this->biz_model->get(array('id' => $id, 'status>-1' => null));
+19 -8
View File
@@ -206,7 +206,8 @@
<div class="am-form-group">
<div class="am-para-input">
<div class="am-input-group am-input-group-primary">
<input type="text" placeholder="详细地址" id="address" name="address" value="<?= $biz['address'] ?>"/>
<input type="text" placeholder="详细地址" id="address" name="address"
value="<?= $biz['address'] ?>"/>
<span class="am-input-group-btn">
<button id="addr-btn" class="am-btn am-btn-primary" type="button"><span
class="am-icon-search"></span></button>
@@ -219,12 +220,14 @@
<div class="am-form-inline">
<div class="am-input-group">
<span class="am-input-group-label">经度</span>
<input type="text" class="am-form-field" placeholder="经度" name="lng" value="<?= $biz['lng'] ?>"
<input type="text" class="am-form-field" placeholder="经度" name="lng"
value="<?= $biz['lng'] ?>"
id="biz-edit-lng">
</div>
<div class="am-input-group">
<span class="am-input-group-label">纬度</span>
<input type="text" class="am-form-field" placeholder="纬度" name="lat" value="<?= $biz['lat'] ?>"
<input type="text" class="am-form-field" placeholder="纬度" name="lat"
value="<?= $biz['lat'] ?>"
id="biz-edit-lat">
</div>
</div>
@@ -254,6 +257,15 @@
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">类型:</label>
<div class="am-para-input wp20">
<select name="type" v-model="info.type">
<option value="0">选择类型</option>
<option v-for="(v,i) in typeAry" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group" style="margin-bottom: 2rem">
<div class="am-para-input">
<button class="am-btn am-btn-success" type="submit">提交</button>
@@ -352,16 +364,15 @@
el: '#vue-app',
data: {
cate_id: <?=$biz['cate_id'] ? $biz['cate_id'] : "''"?>,
info:<?=json_encode($biz)?>,
info: <?=json_encode($biz)?>,
typeAry: <?=json_encode($typeAry)?>,
},
mounted: function () {
},
methods: {
},
methods: {},
created: function () {
},
watch: {
}
watch: {}
});
/**
+4 -5
View File
@@ -6,7 +6,7 @@
* Time: 13:47
*/
defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');
class Biz_model extends HD_Model
{
@@ -63,8 +63,7 @@ class Biz_model extends HD_Model
*/
function type_ary($key = null)
{
$map = array('1' => '品牌店', '2' => '合伙店', '3' => '代理店', '4' => '合作店', '5' => '异业店');
//$map = array('1' => '品牌店', '2' => '合伙店', '3' => '代理店');
$map = array('1' => '空间站', '2' => '车卖场', '3' => '准车卖场', '4' => '二网', '5' => '4类');
if (!is_null($key)) {
return $map[$key];
}
@@ -84,8 +83,8 @@ class Biz_model extends HD_Model
$lng = (float)$lng;
$where = "status=1 and lat>0 and lng>0";
$typeAry = $this->type_ary();
$type_ids = implode(',',array_keys($typeAry));
$where = $where." and type in ($type_ids)";
$type_ids = implode(',', array_keys($typeAry));
$where = $where . " and type in ($type_ids)";
if ($page) {
$offset = ($page - 1) * $size;