123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603 |
- <?php
- namespace Admin\Controller;
- use Common\Controller\AuthController;
- use Think\Controller;
- /**
- * 加盟申请
- * @author: linch
- * Class StoreApplicationController
- * @package Admin\Controller
- */
- class StoreApplicationController extends AuthController
- {
- /**
- * 申请列表
- * @author: linch
- */
- public function application_list() {
- $search = array(
- 's_time' => I('get.s_time'),
- 'e_time' => I('get.e_time'),
- );
- $page_size = 20;
- $page_num = I('p', 1);
- $store_application_model = new \Admin\Model\StoreApplicationModel();
- $data = $store_application_model->get_list($search, $page_num, $page_size);;
- $status = $store_application_model->get_status_list();
- $source = $store_application_model->get_source_list();
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->assign('status', $status);
- $this->assign('source', $source);
- $this->display();
- }
- /**
- * 设置已联系
- * @author: linch
- */
- public function application_set_finish() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $store_application_model = new \Admin\Model\StoreApplicationModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $store_application_model->data_set_finish($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 设置已删除
- * @author: linch
- */
- public function application_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $store_application_model = new \Admin\Model\StoreApplicationModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $store_application_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 留言板管理
- * @author: linch
- */
- public function message_board_list() {
- $search = array(
- 's_time' => I('get.s_time'),
- 'e_time' => I('get.e_time'),
- );
- $page_size = 20;
- $page_num = I('p', 1);
- $message_board_model = new \Admin\Model\MessageBoardModel();
- $data = $message_board_model->get_list($search, $page_num, $page_size);;
- $status = $message_board_model->get_status_list();
- $source = $message_board_model->get_source_list();
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->assign('status', $status);
- $this->assign('source', $source);
- $this->display();
- }
- /**
- * 留言板设置已联系
- * @author: linch
- */
- public function message_board_set_finish() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $message_board_model = new \Admin\Model\MessageBoardModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $message_board_model->data_set_finish($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 设置已删除
- * @author: linch
- */
- public function message_board_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $message_board_model = new \Admin\Model\MessageBoardModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $message_board_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 广告列表
- * @author: linch
- */
- public function ad_message_list() {
- $search = array();
- $page_size = 20;
- $page_num = I('p', 1);
- $ad_message_model = new \Admin\Model\AdMessageModel();
- $data = $ad_message_model->get_list($search, $page_num, $page_size);
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->display();
- }
- /**
- * 添加广告
- * @author: linch
- */
- public function ad_message_add() {
- if (IS_POST) { //新增操作
- $ad_message_model = new \Admin\Model\AdMessageModel();
- $data = I('post.data');
- $info = $this->get_my_info(); //获取登录信息
- $data['admin_id'] = (int)$info['aid'];
- $result = $ad_message_model->data_add($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //新增页面
- $this->display('ad_message_edit');
- }
- }
- /**
- * 删除广告
- * @author: linch
- */
- public function ad_message_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $ad_message_model = new \Admin\Model\AdMessageModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $ad_message_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网门店列表
- * @author: linch
- */
- public function home_store() {
- $search = array(
- 'name' => trim(I('get.name')),
- );
- $page_size = 20;
- $page_num = I('p', 1);
- $home_store_model = new \Admin\Model\HomeStoresModel();
- $data = $home_store_model->get_list($search, $page_num, $page_size);
- $is_new_list = $home_store_model->get_is_new_list();
- $this->assign('is_new_list', $is_new_list);
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->display();
- }
- /**
- * 官网门店新增
- * @author: linch
- */
- public function home_store_add() {
- $home_store_model = new \Admin\Model\HomeStoresModel();
- if (IS_POST) { //新增操作
- $data = I('post.data');
- $result = $home_store_model->data_add($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //新增页面
- //城市
- $home_city_model = new \Common\Model\HomeCityModel();
- $city_data = $home_city_model->where(array('status' => $home_city_model::status_on))->select();
- $is_new_list = $home_store_model->get_is_new_list();
- $this->assign('is_new_list', $is_new_list);
- $this->assign('city', $city_data);
- $this->display('home_store_edit');
- }
- }
- /**
- * 官网门店编辑
- * @author: linch
- */
- public function home_store_edit() {
- $home_store_model = new \Admin\Model\HomeStoresModel();
- if (IS_POST) { //编辑操作
- $data = I('post.data');
- $result = $home_store_model->data_edit($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //编辑页面
- $id = intval(I('get.id'));
- $data = $home_store_model->find($id);
- $home_city_model = new \Common\Model\HomeCityModel();
- $city_data = $home_city_model->where(array('status' => $home_city_model::status_on))->select();
- $is_new_list = $home_store_model->get_is_new_list();
- $this->assign('is_new_list', $is_new_list);
- $this->assign('city', $city_data);
- $this->assign('data', $data);
- $this->display();
- }
- }
- /**
- * 官网门店删除
- * @author: linch
- */
- public function home_store_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_store_model = new \Admin\Model\HomeStoresModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_store_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网门店下架
- * @author: linch
- */
- public function home_store_set_off() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_store_model = new \Admin\Model\HomeStoresModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_store_model->data_set_off($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网门店上架
- * @author: linch
- */
- public function home_store_set_on() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_store_model = new \Admin\Model\HomeStoresModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_store_model->data_set_on($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网城市列表
- * @author: linch
- */
- public function home_city() {
- $search = array(
- 'name' => trim(I('get.name')),
- );
- $page_size = 20;
- $page_num = I('p', 1);
- $home_city_model = new \Admin\Model\HomeCityModel();
- $data = $home_city_model->get_list($search, $page_num, $page_size);
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->display();
- }
- /**
- * 官网城市新增
- * @author: linch
- */
- public function home_city_add() {
- if (IS_POST) { //新增操作
- $home_city_model = new \Admin\Model\HomeCityModel();
- $data = I('post.data');
- $result = $home_city_model->data_add($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //新增页面
- $this->display('home_city_edit');
- }
- }
- /**
- * 官网城市编辑
- * @author: linch
- */
- public function home_city_edit() {
- $home_city_model = new \Admin\Model\HomeCityModel();
- if (IS_POST) { //编辑操作
- $data = I('post.data');
- $result = $home_city_model->data_edit($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //编辑页面
- $id = intval(I('get.id'));
- $data = $home_city_model->find($id);
- $this->assign('data', $data);
- $this->display();
- }
- }
- /**
- * 官网城市删除
- * @author: linch
- */
- public function home_city_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_city_model = new \Admin\Model\HomeCityModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_city_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网新闻列表
- * @author: linch
- */
- public function home_new() {
- $search = array(
- 'title' => trim(I('get.title')),
- );
- $page_size = 20;
- $page_num = I('p', 1);
- $home_new_model = new \Admin\Model\HomeNewModel();
- $data = $home_new_model->get_list($search, $page_num, $page_size);
- //类型、状态
- $type_list = $home_new_model->get_type_list();
- $recommend_list = $home_new_model->get_recommend_list();
- $status_list = $home_new_model->get_status_list();
- $banner_list = $home_new_model->get_banner_list();
- $this->assign('type', $type_list);
- $this->assign('recommend', $recommend_list);
- $this->assign('status', $status_list);
- $this->assign('banner', $banner_list);
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->display();
- }
- /**
- * 官网新闻新增
- * @author: linch
- */
- public function home_new_add() {
- $home_new_model = new \Admin\Model\HomeNewModel();
- if (IS_POST) { //新增操作
- $data = I('post.data');
- $result = $home_new_model->data_add($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //新增页面
- //类型、状态、门店
- $home_store_model = new \Common\Model\HomeStoresModel();
- $store_list = $home_store_model->where(array('status' => $home_store_model::status_on))->select();
- $type_list = $home_new_model->get_type_list();
- $recommend_list = $home_new_model->get_recommend_list();
- $this->assign('store', $store_list);
- $this->assign('type', $type_list);
- $this->assign('recommend', $recommend_list);
- $this->display('home_new_edit');
- }
- }
- /**
- * 官网新闻编辑
- * @author: linch
- */
- public function home_new_edit() {
- $home_new_model = new \Admin\Model\HomeNewModel();
- if (IS_POST) { //编辑操作
- $data = I('post.data');
- $result = $home_new_model->data_edit($data);
- if ($result['code'] == true) {
- $this->success('操作成功');
- } else {
- $this->error($result['msg']);
- }
- } else { //编辑页面
- $id = intval(I('get.id'));
- $data = $home_new_model->find($id);
- //类型、状态、店铺
- $home_store_model = new \Common\Model\HomeStoresModel();
- $store_list = $home_store_model->where(array('status' => $home_store_model::status_on))->select();
- $type_list = $home_new_model->get_type_list();
- $recommend_list = $home_new_model->get_recommend_list();
- $this->assign('store', $store_list);
- $this->assign('type', $type_list);
- $this->assign('recommend', $recommend_list);
- $this->assign('data', $data);
- $this->display();
- }
- }
- /**
- * 官网新闻删除
- * @author: linch
- */
- public function home_new_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_new_model = new \Admin\Model\HomeNewModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_new_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网新闻下架
- * @author: linch
- */
- public function home_new_set_off() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_new_model = new \Admin\Model\HomeNewModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_new_model->data_set_off($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网新闻上架
- * @author: linch
- */
- public function home_new_set_on() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_new_model = new \Admin\Model\HomeNewModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_new_model->data_set_on($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网新闻设置成banner
- * @author: linch
- */
- public function home_new_set_banner_on(){
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_new_model = new \Admin\Model\HomeNewModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_new_model->data_set_banner_on($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * 官网新闻取消设置banner
- * @author: linch
- */
- public function home_new_set_banner_off(){
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_new_model = new \Admin\Model\HomeNewModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_new_model->data_set_banner_off($id);
- }
- $this->success('操作成功');
- }
- }
- /**
- * email邮箱列表
- * @author: linch
- */
- public function home_email(){
- $search = array();
- $page_size = 20;
- $page_num = I('p', 1);
- $home_sub_model = new \Admin\Model\HomeSubscriptionModel();
- $data = $home_sub_model->get_list($search, $page_num, $page_size);
- //状态
- $status_list = $home_sub_model->get_status_list();
- $this->assign('status', $status_list);
- $this->assign('search', $search);
- $this->assign('list', $data['list']);
- $this->assign('pager', $data['pager']);
- $this->display();
- }
- /**
- * email邮箱删除
- * @author: linch
- */
- public function home_email_del() {
- $data = I('post.data');
- if (empty($data)) {
- $this->error('无数据操作,请勾选要修改的数据');
- } else {
- $home_sub_model = new \Admin\Model\HomeSubscriptionModel();
- foreach ($data as $key => $val) {
- $id = intval($val['id']);
- $home_sub_model->data_del($id);
- }
- $this->success('操作成功');
- }
- }
- }
|