初始化代码
This commit is contained in:
173
app/shop/controller/AdminFreight.php
Normal file
173
app/shop/controller/AdminFreight.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
namespace app\shop\controller;
|
||||
use app\AdminRest;
|
||||
use app\shop\model\Article;
|
||||
use app\shop\model\Banner;
|
||||
use app\shop\model\Date;
|
||||
use app\shop\model\FreightConfig;
|
||||
use app\shop\model\FreightProvince;
|
||||
use app\shop\model\FreightTemplate;
|
||||
use app\shop\model\Goods;
|
||||
use app\shop\model\Integral;
|
||||
use app\shop\model\OrderGoods;
|
||||
use app\shop\model\RefundOrder;
|
||||
use app\shop\model\Wallet;
|
||||
use think\App;
|
||||
use app\shop\model\User as Model;
|
||||
|
||||
|
||||
class AdminFreight extends AdminRest
|
||||
{
|
||||
|
||||
|
||||
protected $model;
|
||||
|
||||
protected $config_model;
|
||||
|
||||
protected $province_model;
|
||||
|
||||
public function __construct(App $app) {
|
||||
|
||||
parent::__construct($app);
|
||||
|
||||
$this->model = new FreightTemplate();
|
||||
|
||||
$this->config_model = new FreightConfig();
|
||||
|
||||
$this->province_model = new FreightProvince();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author chenniang
|
||||
* @DataTime: 2021-10-29 13:43
|
||||
* @功能说明:模版列表
|
||||
*/
|
||||
public function tmplList(){
|
||||
|
||||
$input = $this->_param;
|
||||
|
||||
$dis[] = ['uniacid','=',$this->_uniacid];
|
||||
|
||||
if(isset($input['status'])){
|
||||
|
||||
$dis[] = ['status','=',$input['status']];
|
||||
}else{
|
||||
|
||||
$dis[] = ['status','>',-1];
|
||||
}
|
||||
|
||||
if(!empty($input['title'])){
|
||||
|
||||
$dis[] = ['title','like','%'.$input['title'].'%'];
|
||||
}
|
||||
|
||||
$data = $this->model->dataList($dis,$input['limit']);
|
||||
|
||||
return $this->success($data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author chenniang
|
||||
* @DataTime: 2021-10-29 13:43
|
||||
* @功能说明:模版列表
|
||||
*/
|
||||
public function tmplSelect(){
|
||||
|
||||
$input = $this->_param;
|
||||
|
||||
$dis[] = ['uniacid','=',$this->_uniacid];
|
||||
|
||||
$dis[] = ['status','=',1];
|
||||
|
||||
if(!empty($input['title'])){
|
||||
|
||||
$dis[] = ['title','like','%'.$input['title'].'%'];
|
||||
}
|
||||
|
||||
$data = $this->model->where($dis)->order('id desc')->select()->toArray();
|
||||
|
||||
return $this->success($data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author chenniang
|
||||
* @DataTime: 2022-07-11 15:47
|
||||
* @功能说明:添加运费模版
|
||||
*/
|
||||
public function tmplAdd(){
|
||||
|
||||
$input = $this->_input;
|
||||
|
||||
$input['uniacid'] = $this->_uniacid;
|
||||
|
||||
$res = $this->model->tmplAdd($input);
|
||||
|
||||
return $this->success($res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author chenniang
|
||||
* @DataTime: 2022-07-11 16:44
|
||||
* @功能说明:编辑运费模版
|
||||
*/
|
||||
public function tmplUpdate(){
|
||||
|
||||
$input = $this->_input;
|
||||
|
||||
$dis = [
|
||||
|
||||
'id' => $input['id']
|
||||
];
|
||||
|
||||
$input['uniacid'] = $this->_uniacid;
|
||||
|
||||
$res = $this->model->tmplUpdate($dis,$input);
|
||||
|
||||
return $this->success($res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author chenniang
|
||||
* @DataTime: 2022-07-11 16:45
|
||||
* @功能说明:模版详情
|
||||
*/
|
||||
public function tmplInfo(){
|
||||
|
||||
$input = $this->_param;
|
||||
|
||||
$dis = [
|
||||
|
||||
'id' => $input['id']
|
||||
];
|
||||
|
||||
$input['uniacid'] = $this->_uniacid;
|
||||
|
||||
$res = $this->model->dataInfo($dis);
|
||||
|
||||
return $this->success($res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user