|
@@ -5,6 +5,9 @@ namespace app\mobile\logic;
|
|
use app\model\AccountModel;
|
|
use app\model\AccountModel;
|
|
use app\model\AccountTokenModel;
|
|
use app\model\AccountTokenModel;
|
|
use app\model\CommonModel;
|
|
use app\model\CommonModel;
|
|
|
|
+use app\model\GroupModel;
|
|
|
|
+use app\model\ThemeModel;
|
|
|
|
+use app\model\VideoModel;
|
|
use think\Exception;
|
|
use think\Exception;
|
|
use think\facade\Config;
|
|
use think\facade\Config;
|
|
use think\facade\Db;
|
|
use think\facade\Db;
|
|
@@ -65,7 +68,7 @@ class AccountLogic extends BaseLogic
|
|
}
|
|
}
|
|
|
|
|
|
//登出
|
|
//登出
|
|
- public static function logout(string $token = ''): Json
|
|
|
|
|
|
+ public static function logout(): Json
|
|
{
|
|
{
|
|
|
|
|
|
$info = AccountTokenModel::where(['accountid' => self::$aid])->save(['token' => '', 'expiretime' => date('Y-m-d H:i:s')]);
|
|
$info = AccountTokenModel::where(['accountid' => self::$aid])->save(['token' => '', 'expiretime' => date('Y-m-d H:i:s')]);
|
|
@@ -87,4 +90,62 @@ class AccountLogic extends BaseLogic
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //视频列表
|
|
|
|
+ public static function getVideoList(array $data = []): Json
|
|
|
|
+ {
|
|
|
|
+ $rs = AccountModel::field('id,video_ids')
|
|
|
|
+ ->where(['id' => self::$aid, 'is_del' => CommonModel::$del_normal])
|
|
|
|
+ ->findOrEmpty()
|
|
|
|
+ ->toArray();
|
|
|
|
+
|
|
|
|
+ if (empty($rs)) return json_show(CommonModel::$error_param, '该账户不存在');
|
|
|
|
+
|
|
|
|
+ $db = VideoModel::where(['is_del' => CommonModel::$del_normal, 'status' => CommonModel::$status_normal])
|
|
|
|
+ ->whereIn('id', $rs['video_ids']);
|
|
|
|
+
|
|
|
|
+ $count = $db->count('id');
|
|
|
|
+
|
|
|
|
+ $list = $db
|
|
|
|
+ ->field('id,video_sn,video_name,video_url,video_img')
|
|
|
|
+ ->page($data['page'], $data['size'])
|
|
|
|
+ ->order(['weight' => 'desc', 'id' => 'desc'])
|
|
|
|
+ ->select()
|
|
|
|
+ ->toArray();
|
|
|
|
+
|
|
|
|
+ return json_show(CommonModel::$success, '获取视频列表成功', ['count' => $count, 'list' => $list]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //手机主题
|
|
|
|
+ public static function theme(): Json
|
|
|
|
+ {
|
|
|
|
+ $group_id = GroupModel::where(['is_del' => CommonModel::$del_normal, 'company_id' => self::$company_id, 'card_id' => self::$card_id])
|
|
|
|
+ ->value('id', 0);
|
|
|
|
+ if (!$group_id) return json_show(CommonModel::$error_param, '该账户所对应的分组不存在');
|
|
|
|
+
|
|
|
|
+ $rs = ThemeModel::field('id,code')
|
|
|
|
+ ->where(['is_del' => CommonModel::$del_normal, 'group_id' => $group_id, 'status' => CommonModel::$status_normal])
|
|
|
|
+ ->append(['modular'])
|
|
|
|
+ ->withAttr('modular', function ($val, $data) {
|
|
|
|
+ return Db::name('theme_modular')
|
|
|
|
+ ->field('id,title,type')
|
|
|
|
+ ->where(['is_del' => CommonModel::$del_normal, 'theme_id' => $data['id'], 'status' => CommonModel::$status_normal])
|
|
|
|
+ ->order(['addtime' => 'desc', 'id' => 'desc'])
|
|
|
|
+ ->append(['data'])
|
|
|
|
+ ->withAttr('data', function ($v, $d) {
|
|
|
|
+ return Db::name('theme_modular_data')
|
|
|
|
+ ->field('id,img,jump_type,jump_param,good_name,good_id,style_type')
|
|
|
|
+ ->where(['is_del' => CommonModel::$del_normal, 'theme_modular_id' => $d['id']])
|
|
|
|
+ ->order(['addtime' => 'desc', 'id' => 'desc'])
|
|
|
|
+ ->select()
|
|
|
|
+ ->toArray();
|
|
|
|
+ })
|
|
|
|
+ ->select()
|
|
|
|
+ ->toArray();
|
|
|
|
+ })
|
|
|
|
+ ->findOrEmpty()
|
|
|
|
+ ->toArray();
|
|
|
|
+ return empty($rs) ? json_show(CommonModel::$error_param, '该手机主题不存在') : json_show(CommonModel::$success, '获取手机主题成功', $rs);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|