123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
-
-
- namespace app\admin\logic;
-
- use think\Model;
- use think\Db;
- use think\Request;
-
-
- class DiyExtendLogic extends Model
- {
- private $request = null;
- private $admin_lang = 'cn';
-
-
-
- function __construct() {
- null === $this->request && $this->request = Request::instance();
- $this->admin_lang = get_admin_lang();
- }
-
-
-
- public function getChannelid()
- {
- $channeltype = input('param.channeltype/d', 0);
- $channel = input('param.channel/d', $channeltype);
- if (!empty($channel)) {
- return $channel;
- }
-
- $controller_name = input('param.controller_name/s', '');
- if (empty($controller_name)) {
- $controller_name = $this->request->controller();
- }
-
- if ('Custom' != $controller_name) {
- $channel = Db::name('channeltype')->where([
- 'ctl_name' => $controller_name,
- ])->getField('id');
- }
-
- return $channel;
- }
- }
|