mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改数据获取
This commit is contained in:
parent
4c9195955c
commit
d18a46286f
@ -2,7 +2,9 @@
|
||||
|
||||
namespace app\data\controller;
|
||||
|
||||
use app\data\service\ExpressService;
|
||||
use app\data\service\GoodsService;
|
||||
use app\data\service\UserUpgradeService;
|
||||
use think\admin\Controller;
|
||||
use think\admin\extend\CodeExtend;
|
||||
|
||||
@ -152,11 +154,12 @@ class ShopGoods extends Controller
|
||||
$data['marks'] = str2arr($data['marks'] ?? '');
|
||||
$data['payment'] = str2arr($data['payment'] ?? '');
|
||||
$data['cateids'] = str2arr($data['cateids'] ?? '');
|
||||
// 其他表单数据
|
||||
$this->marks = GoodsService::instance()->getMarkData();
|
||||
$this->cates = GoodsService::instance()->getCateData();
|
||||
$this->trucks = $this->app->db->name('ShopTruckTemplate')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('code,name', 'code');
|
||||
$this->trucks = ExpressService::instance()->templates();
|
||||
$this->upgrades = UserUpgradeService::instance()->levels();
|
||||
$this->payments = $this->app->db->name('ShopPayment')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('type,code,name', 'code');
|
||||
$this->upgrades = $this->app->db->name('DataUserUpgrade')->where(['status' => 1, 'deleted' => 0])->order('number asc,id desc')->column('number,name', 'id');
|
||||
$this->discounts = $this->app->db->name('DataUserDiscount')->where(['status' => 1, 'deleted' => 0])->order('sort desc,id desc')->column('id,name,items', 'id');
|
||||
// 商品规格处理
|
||||
$fields = 'goods_sku `sku`,goods_code,goods_spec `key`,price_selling `selling`,price_market `market`,number_virtual `virtual`,number_express `express`,reward_balance `balance`,reward_integral `integral`,status';
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\data\controller;
|
||||
|
||||
use app\data\service\UserUpgradeService;
|
||||
use think\admin\Controller;
|
||||
|
||||
/**
|
||||
@ -70,9 +71,6 @@ class UserDiscount extends Controller
|
||||
/**
|
||||
* 表单数据处理
|
||||
* @param array $vo
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
protected function _form_filter(array &$vo)
|
||||
{
|
||||
@ -84,8 +82,7 @@ class UserDiscount extends Controller
|
||||
}
|
||||
$vo['items'] = json_encode($rule, JSON_UNESCAPED_UNICODE);
|
||||
} else {
|
||||
$query = $this->app->db->name('DataUserUpgrade');
|
||||
$this->levels = $query->where(['status' => 1])->order('number asc')->select()->toArray();
|
||||
$this->levels = UserUpgradeService::instance()->levels();
|
||||
if (empty($this->levels)) $this->error('未配置用户等级!');
|
||||
if (!empty($vo['items'])) foreach (json_decode($vo['items'], true) as $item) {
|
||||
$vo["_level_{$item['level']}"] = $item['discount'];
|
||||
|
@ -29,8 +29,7 @@ class UserUpgrade extends Controller
|
||||
public function index()
|
||||
{
|
||||
$this->title = '用户等级管理';
|
||||
$query = $this->_query($this->table);
|
||||
$query->where(['deleted' => 0])->order('number asc')->page();
|
||||
$this->_query($this->table)->order('number asc')->page();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,6 +49,18 @@ class ExpressService extends Service
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取快递模板数据
|
||||
* @return array
|
||||
*/
|
||||
public function templates(): array
|
||||
{
|
||||
$map = ['status' => 1, 'deleted' => 0];
|
||||
$query = $this->app->db->name('ShopTruckTemplate')->where($map);
|
||||
return $query->order('sort desc,id desc')->column('code,name,normal,content', 'code');
|
||||
}
|
||||
|
||||
/**
|
||||
* 配送区域树型数据
|
||||
* @param integer $level 最大级别
|
||||
|
Loading…
x
Reference in New Issue
Block a user