原生态开发方式是指通过原始的编程语言和工具进行应用程序的开发,与使用跨平台框架或开发工具不同。
在原生态开发中,开发人员使用特定于平台的编程语言和工具,例如使用Java和Android Studio进行Android应用程序开发,使用Objective-C或Swift和Xcode进行iOS应用程序开发。
原生开发方式的优点包括:
- 性能:原生应用程序可以直接访问设备的底层功能和硬件,因此通常具有更高的性能。
- 用户体验:原生应用程序可以根据平台的界面准则和用户习惯进行设计,提供更好的用户体验。
- 功能和功能:原生应用程序可以利用平台特定的功能和功能,提供更丰富的功能。
然而,原生开发方式也存在一些挑战:
- 多平台支持:如果需要在多个平台上开发应用程序,原生开发可能需要不同的技术栈和开发团队。
- 开发时间和成本:原生应用程序通常需要更多的开发时间和资源来完成。
- 更新和维护:如果需要对应用程序进行更新或修复漏洞,原生应用程序可能需要分别为每个平台进行更新。
代码分享
**
* Created by PhpStorm.
* User: ikinvin
* Date: 2021/2/24
* Time: 11:32 AM
*/
class App_Controller_Manage_AgentController extends App_Controller_Manage_InitController
{
// 对象
private static $agent_admin;//代理商
private $applet_config_model;//小程序配置
private $status_arr;
private $open_type;
private $settle_type;
private $rebate;
private $level;
private $skin_theme;
private $open;
private $auth_type;
private $recharge_type;
public $types_arr;
public function __construct()
{
self::$agent_admin = new App_Model_Agent_MysqlAdminStorage();
$this->applet_config_model = new App_Model_Applet_MysqlAppletCfgStorage();
$this->status_arr = [
0 => '<font color="green">正常</font>',
1 => '<font color="red">封禁</font>',
2 => '<font color="orange">待审核</font>',
];
$this->open_type = plum_parse_config('open_type', 'agent');
$this->settle_type = plum_parse_config('settle_type', 'agent');
$this->rebate = plum_parse_config('discount', 'agent');
$this->level = plum_parse_config('grade', 'agent');
$this->skin_theme = plum_parse_config('skin_theme', 'agent');
$this->open = array(0 => '不允许', 1 => '允许');
$this->auth_type= plum_parse_config('auth_produce_type', 'agent');
$this->recharge_type = [
//1 =>'充值微币',
2 => '充值抖币',
3 => '充值算力值',
];
$this->types_arr = [
1 => '微信',
2 => '抖音',
3 => '快手',
];
parent::__construct();
}
/**
* 代理商-列表
* @return void
*/
public function lists()
{
$aa_id = $this->request->getStrParam('aa_id','');
$time_range = $this->request->getStrParam('time_range');
$keyword_type = $this->request->getStrParam('keyword_type');
$keyword = $this->request->getStrParam('keyword');
$auth_type = $this->request->getIntParam('aa_open_auth_type');
$where = [];
array_push($where, array('name' => 'aa_broker_type', 'oper' => 'in', 'value' => [1, 3]));
if (!empty($keyword_type)) {
array_push($where, ['name' => $keyword_type, 'oper' => 'like', 'value' => "%{$keyword}%"]);
}
if (!empty($time_range)) {
$add_time_range_arr = explode('~', $time_range);
array_push($where, ['name' => 'aa_agent_expire', 'oper' => '>=', 'value' => strtotime($add_time_range_arr[0])]);
array_push($where, ['name' => 'aa_agent_expire', 'oper' => '<', 'value' => strtotime($add_time_range_arr[1]) + 86400]);
}
if ($auth_type) {
array_push($where, array('name' => 'aa_open_auth_type', 'oper' => '=', 'value' => $auth_type));
}
if($aa_id){
array_push($where, array('name' => 'aa_id', 'oper' => '=', 'value' => $aa_id));
}
$sort = array('aa_id' => 'DESC');
$lists = self::$agent_admin->getList($where, $this->index, $this->count, $sort);
if ($lists) {
$free = array(
0 => '未开通',
1 => '<font color="green">已开通</font>',
);
//点数记录表
$collect_model = new App_Model_Douyin_MysqlCollectAgentStorage();
$open_storage = new App_Model_Douyin_MysqlShopStorage();
$curr = time();
$colony_domain = plum_parse_config('colony', 'system');
$aliyun_model = new App_Model_Video_MysqlAliyunCfgStorage();
foreach ($lists as &$val) {
$fmanager = self::$agent_admin->getRowById($val['aa_fid']);
$fname = $fmanager ? $fmanager['aa_name'] : '--';
$val['fname'] = $fname;
$val['aa_open_name'] = $this->open_type[$val['aa_open_status']] . '代理商';
//同步登录
$val['aa_open_auth_type_name'] = $this->auth_type[$val['aa_open_auth_type']]['produce'];
$params = array('username' => $val['aa_mobile'], 'check' => $val['aa_password'], 'action' => 'synlogin', 'expire'=>$curr);
$code = plum_authcode(http_build_query($params), 'ENCODE');
$code = urlencode($code);
$access_domain = empty($val['aa_store_db']) ? '' : $colony_domain[$val['aa_store_db']]['access'];
$auth_url = $access_domain.'/dydqt/user/syslogin/';//同步登录认证URL
$val['dydqt_url'] = $auth_url."?time={$curr}&code={$code}";
$val['current_rebate'] = (isset($this->rebate[$val['aa_rebate']]) ? $this->rebate[$val['aa_rebate']] : '无');
$val['continue_rebate'] = (isset($this->rebate[$val['aa_renew_rebate']]) ? $this->rebate[$val['aa_renew_rebate']] : '无');
$collect_result = $collect_model->getRowByAid($val['aa_id']);
$val['ca_rest_num'] = $collect_result ? $collect_result['ca_rest_num'] : 0;
$shopTotal = $open_storage->getCountByAgentId($val['aa_id']);
$val['shopTotal'] = $shopTotal;
$val['level'] = $this->level[$val['aa_level']];
$val['open'] = $this->open[$val['aa_open_lower']];
$val['status'] = $this->status_arr[$val['aa_status']];
$configs = $this->applet_config_model->findAppletsByAid($val['aa_id']);
$val['applet_num'] = count($configs);
$val['aa_agent_expire'] = date('Y-m-d', $val['aa_agent_expire'] ? $val['aa_agent_expire'] : ($val['aa_create_time'] + 365 * 24 * 60 * 60));
$val['aa_create_time'] = date('Y-m-d', $val['aa_create_time']);
$val['last'] = $val['aa_last_time'] ? date('Y-m-d H:i:s', $val['aa_last_time']) : '无';
$val['aa_active_time'] = $val['aa_active_time'] ? date('Y-m-d H:i:s', $val['aa_active_time']) : '无';
//阿里云剪辑,域名配置
if ($val['aa_open_auth_type'] == 14) {
$aliyun_cfg = $aliyun_model->getAliyunConfig($val['aa_id'], 0);
if ($aliyun_cfg) {
$oss_client = new App_Plugin_Aliyun_OSSClient($aliyun_cfg);
$oss_host = $oss_client->getHost();
$val['oss_host'] = $oss_host;
}
}
}
}