当前位置:网站首页>Introduction to the development function of Hanlin Youshang system of Hansheng Youpin app
Introduction to the development function of Hanlin Youshang system of Hansheng Youpin app
2022-07-05 18:10:00 【weixin_ two billion forty-seven million six hundred and seventy】
Recently, a new set of ( Hansheng premium products app) Hanlin Youshang system , Its main functions are mall system , Member system , Mission system , Payment system , Points management system , Online consultation system and so on .
Hansheng premium products app characteristic :
1、 Select Meifu online special mobile shopping software , Update all kinds of activity offers and welfare products in real time .
2、 Constantly search for a large number of low-cost goods through Premium software , Select high-quality goods with many discounts .
3、 Bring more high-quality online shopping experience to consumers , Rich and good goods, buy at a low price, save money and rest assured .
Hansheng premium products app advantage :
1、 There are a wide range of goods, good quality and low price , Let you rest assured to buy good goods .
2、 Mobile social e-commerce APP, It aims to select high-quality products with high cost performance for users .
3、 Products related to food 、 beauty 、 clothing 、 Maternal and infant 、 Daily necessities and other fields .
Hansheng premium products app Bright spot :
1、 The latest and most comprehensive shopping experience will not disappoint you , Everyone can try .
2、 Everyone can buy good goods suitable for themselves , The above discounts and rewards are quite comprehensive .
3、 Feel free to experience , So many discounts won't let you go home empty handed , You can come together .
Hansheng premium products app Small make up comment on :
1、 The update of various commodities is still very timely , You can see all kinds of new product information every day ;
2、 There are no restrictions on direct mobile online orders , All the goods have been checked by specially assigned personnel ;
3、 You can also get coupons through this platform , As long as you place an order, you can directly deduct .
Han Sheng Superior products app System development source code sharing :
<?php
namespace app\admin\controller\article;
use think\facade\Route as Url;
use app\admin\controller\AuthController;
use app\admin\model\system\SystemAttachment;
use app\admin\model\article\{ArticleCategory as ArticleCategoryModel,Article as ArticleModel};
use crmeb\services\{FormBuilder as Form,UtilService as Util,JsonService as Json};
/**
* Article classification management controller
* */
class ArticleCategory extends AuthController
{
/**
* Classification management
* */
public function index()
{
$where = Util::getMore([
['status', ''],
['title', ''],
], $this->request);
$this->assign('where', $where);
$this->assign(ArticleCategoryModel::systemPage($where));
return $this->fetch();
}
/**
* Add Category Management
* */
public function create()
{
$f = array();
$f[] = Form::select('pid', ' Parent id')->setOptions(function () {
$list = ArticleCategoryModel::getTierList();
$menus[] = ['value' => 0, 'label' => ' Top class '];
foreach ($list as $menu) {
$menus[] = ['value' => $menu['id'], 'label' => $menu['html'] . $menu['title']];
}
return $menus;
})->filterable(1);
$f[] = Form::input('title', ' Category name ');
$f[] = Form::input('intr', ' Classification introduction ')->type('textarea');
$f[] = Form::frameImageOne('image', ' Sort of pictures ', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('image')->width('100%')->height('500px');
$f[] = Form::number('sort', ' Sort ', 0);
$f[] = Form::radio('status', ' state ', 1)->options([['value' => 1, 'label' => ' Show '], ['value' => 0, 'label' => ' hide ']]);
$form = Form::make_post_form(' Add categories ', $f, Url::buildUrl('save'));
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
/**
* s To upload pictures
* */
public function upload()
{
$res = Upload::instance()->setUploadPath('article')->image('file');
if (!is_array($res)) return Json::fail($res);
SystemAttachment::attachmentAdd($res['name'], $res['size'], $res['type'], $res['dir'], $res['thumb_path'], 5, $res['image_type'], $res['time']);
return Json::successful(' Image upload succeeded !', ['name' => $res['name'], 'url' => path_to_url($res['thumb_path'])]);
}
/**
* Save classification management
* */
public function save()
{
$data = Util::postMore([
'title',
'pid',
'intr',
['new_id', []],
['image', []],
['sort', 0],
'status',]);
if (!$data['title']) return Json::fail(' Please enter the classification name ');
if (count($data['image']) != 1) return Json::fail(' Please select a category picture , And you can only upload one ');
if ($data['sort'] < 0) return Json::fail(' Sorting cannot be negative ');
$data['add_time'] = time();
$data['image'] = $data['image'][0];
$new_id = $data['new_id'];
unset($data['new_id']);
$res = ArticleCategoryModel::create($data);
if (!ArticleModel::saveBatchCid($res['id'], implode(',', $new_id))) return Json::fail(' Failed to add the article list ');
return Json::successful(' Category added successfully !');
}
/**
* Modify the classification
* */
public function edit($id)
{
if (!$id) return $this->failed(' Parameter error ');
$article = ArticleCategoryModel::get($id)->getData();
if (!$article) return Json::fail(' The data doesn't exist !');
$f = array();
$f[] = Form::select('pid', ' Parent id', (string)$article['pid'])->setOptions(function () {
$list = ArticleCategoryModel::getTierList();
$menus[] = ['value' => 0, 'label' => ' Top class '];
foreach ($list as $menu) {
$menus[] = ['value' => $menu['id'], 'label' => $menu['html'] . $menu['title']];
}
return $menus;
})->filterable(1);
$f[] = Form::input('title', ' Category name ', $article['title']);
$f[] = Form::input('intr', ' Classification introduction ', $article['intr'])->type('textarea');
$f[] = Form::frameImageOne('image', ' Sort of pictures ', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $article['image'])->icon('image')->width('100%')->height('500px');
$f[] = Form::number('sort', ' Sort ', $article['sort']);
$f[] = Form::radio('status', ' state ', $article['status'])->options([['value' => 1, 'label' => ' Show '], ['value' => 0, 'label' => ' hide ']]);
$form = Form::make_post_form(' Edit category ', $f, Url::buildUrl('update', array('id' => $id)));
$this->assign(compact('form'));
return $this->fetch('public/form-builder');
}
public function update($id)
{
$data = Util::postMore([
'pid',
'title',
'intr',
// ['new_id',[]],
['image', []],
['sort', 0],
'status',]);
if (!$data['title']) return Json::fail(' Please enter the classification name ');
if (count($data['image']) != 1) return Json::fail(' Please select a category picture , And you can only upload one ');
if ($data['sort'] < 0) return Json::fail(' Sorting cannot be negative ');
$data['image'] = $data['image'][0];
if (!ArticleCategoryModel::get($id)) return Json::fail(' The edited record does not exist !');
// if(!ArticleModel::saveBatchCid($id,implode(',',$data['new_id']))) return Json::fail(' Failed to add the article list ');
// unset($data['new_id']);
ArticleCategoryModel::edit($data, $id);
return Json::successful(' Modification successful !');
}
/**
* Delete category
* */
public function delete($id)
{
$res = ArticleCategoryModel::delArticleCategory($id);
if (!$res)
return Json::fail(ArticleCategoryModel::getErrorInfo(' Delete failed , Please try again later !'));
else
return Json::successful(' Delete successful !');
}
}
边栏推荐
- 南京大学:新时代数字化人才培养方案探讨
- Record a case of using WinDbg to analyze memory "leakage"
- 彻底理解为什么网络 I/O 会被阻塞?
- Teamcenter 消息注册前操作或後操作
- 吳恩達團隊2022機器學習課程,來啦
- How can cluster deployment solve the needs of massive video access and large concurrency?
- Memory management chapter of Kobayashi coding
- 登录连接 CDB 和 PDB
- Star Ring Technology launched transwarp Navier, a data element circulation platform, to help enterprises achieve secure data circulation and collaboration under privacy protection
- 小林coding的内存管理章节
猜你喜欢
模拟百囚徒问题
图扑软件数字孪生 | 基于 BIM 技术的可视化管理系统
To solve the stubborn problem of Lake + warehouse hybrid architecture, xinghuan Technology launched an independent and controllable cloud native Lake warehouse integrated platform
mybash
Sophon AutoCV:助力AI工业化生产,实现视觉智能感知
Star Ring Technology launched transwarp Navier, a data element circulation platform, to help enterprises achieve secure data circulation and collaboration under privacy protection
Leetcode daily question: the first unique character in the string
IDC report: Tencent cloud database ranks top 2 in the relational database market!
node_ Exporter memory usage is not displayed
RSE2020/云检测:基于弱监督深度学习的高分辨率遥感图像精确云检测
随机推荐
检查命名空间和类
消除`if()else{ }`写法
钉钉开放平台小程序API的缓存接口都有哪些内容?
Star ring technology data security management platform defender heavy release
Notes on common management commands of openshift
[paddleclas] common commands
小白入门NAS—快速搭建私有云教程系列(一)[通俗易懂]
集群部署如何解决海量视频接入与大并发需求?
node_ Exporter memory usage is not displayed
[paddlepaddle] paddedetection face recognition custom data set
How awesome is the architecture of "12306"?
Action avant ou après l'enregistrement du message teamcenter
Elk log analysis system
数值计算方法 Chapter8. 常微分方程的数值解
How can cluster deployment solve the needs of massive video access and large concurrency?
Le cours d'apprentissage de la machine 2022 de l'équipe Wunda arrive.
Numerical calculation method chapter8 Numerical solutions of ordinary differential equations
Sophon kg upgrade 3.1: break down barriers between data and liberate enterprise productivity
How to solve the error "press any to exit" when deploying multiple easycvr on one server?
彻底理解为什么网络 I/O 会被阻塞?