Exception: FLEA_Db_Exception_MissingPrimaryKey
Message: The value of primary key "pid" is missing.
Filename: D:\wwwroot\curtismen\wwwroot\app\front\Controller\products.php [148]
#6 FLEA_Db_TableDataGateway::update(array(1))
ARGS:
Array
(
[0] => Array
(
[count] => 1
)
)
SOURCE CODE:
| 138 |
/**
|
| 139 |
* 商品详细信息
|
| 140 |
*/
|
| 141 |
function productviewdata($pid){
|
| 142 |
$_products=&FLEA::getSingleton('table_products');
|
| 143 |
$_products->getLink('productclass')->linkRead=true;
|
| 144 |
$_products->getLink('productimage')->linkRead=true;
|
| 145 |
|
| 146 |
$product=$_products->find($pid);
|
| 147 |
$product['count']=$product['count']+1;
|
| 148 |
$_products->update($product);//更新点击次数
|
| 149 |
|
| 150 |
$_user=&FLEA::getSingleton('table_users');
|
| 151 |
$uid=$_SESSION['yiyo_login']['uid'];
|
| 152 |
if($uid){
|
| 153 |
$user=$_user->find($uid);
|
| 154 |
$ugid=$user['ugid'];
|
| 155 |
$_ug=&FLEA::getSingleton('table_usergroup');
|
| 156 |
$ug=$_ug->find($ugid);
|
| 157 |
$discount=$ug['discount'];//会员折扣
|
| 158 |
$username=$user['username'];
|
Filename: D:\wwwroot\curtismen\wwwroot\app\front\Controller\products.php [264]
#5 controller_products::productviewdata(0)
ARGS:
Array
(
[0] => 0
)
SOURCE CODE:
| 254 |
//dump($zengpin);
|
| 255 |
$viewdata=array_merge($this->viewdata,$date);
|
| 256 |
return $viewdata;
|
| 257 |
}
|
| 258 |
|
| 259 |
function actionproductview(){
|
| 260 |
$_pclass=&FLEA::getSingleton('table_pclass');
|
| 261 |
$pclass=$_pclass->find("pid='".$this->get('pid',true)."'");
|
| 262 |
$_productclass=&FLEA::getSingleton('table_productclass');
|
| 263 |
$productclass=$_productclass->find($pclass['tid']);
|
| 264 |
$data=$this->productviewdata($this->get('pid',true));
|
| 265 |
switch ($productclass['f_tid']){
|
| 266 |
case 1:$this->_executeView('chenyiview.html', $data);break;
|
| 267 |
case 2:$this->_executeView('lingdaiview.html', $data);break;
|
| 268 |
case 3:$this->_executeView('xiukouview.html', $data);break;
|
| 269 |
default:$this->_executeView('lingdaiview.html', $data);break;
|
| 270 |
}
|
| 271 |
}
|
| 272 |
function actionchenyiview(){
|
| 273 |
$data=$this->productviewdata($this->get('pid',true));
|
| 274 |
$this->_executeView('chenyiview.html', $data);
|
Filename: D:\wwwroot\curtismen\wwwroot\lib\flea\FLEA\Dispatcher\Simple.php [120]
#4 controller_products::actionproductview()
ARGS:
Array
(
)
SOURCE CODE:
| 110 |
}
|
| 111 |
if (method_exists($controller, '__setDispatcher')) {
|
| 112 |
$controller->__setDispatcher($this);
|
| 113 |
}
|
| 114 |
|
| 115 |
// 调用 _beforeExecute() 方法
|
| 116 |
if (method_exists($controller, '_beforeExecute')) {
|
| 117 |
$controller->_beforeExecute($actionMethod);
|
| 118 |
}
|
| 119 |
// 执行 action 方法
|
| 120 |
$ret = $controller->{$actionMethod}();
|
| 121 |
// 调用 _afterExecute() 方法
|
| 122 |
if (method_exists($controller, '_afterExecute')) {
|
| 123 |
$controller->_afterExecute($actionMethod);
|
| 124 |
}
|
| 125 |
return $ret;
|
| 126 |
} while (false);
|
| 127 |
|
| 128 |
if ($callback) {
|
| 129 |
// 检查是否调用应用程序设置的错误处理程序
|
| 130 |
$args = array($controllerName, $actionName, $controllerClass);
|
Filename: D:\wwwroot\curtismen\wwwroot\lib\flea\FLEA\Dispatcher\Auth.php [127]
#3 FLEA_Dispatcher_Simple::_executeAction('products', 'productview', 'Controller_products')
ARGS:
Array
(
[0] => products
[1] => productview
[2] => Controller_products
)
SOURCE CODE:
| 117 |
* @return mixed
|
| 118 |
*/
|
| 119 |
function dispatching()
|
| 120 |
{
|
| 121 |
$controllerName = $this->getControllerName();
|
| 122 |
$actionName = $this->getActionName();
|
| 123 |
$controllerClass = $this->getControllerClass($controllerName);
|
| 124 |
|
| 125 |
if ($this->check($controllerName, $actionName, $controllerClass)) {
|
| 126 |
// 检查通过,执行控制器方法
|
| 127 |
return $this->_executeAction($controllerName, $actionName, $controllerClass);
|
| 128 |
} else {
|
| 129 |
// 检查失败
|
| 130 |
$callback = FLEA::getAppInf('dispatcherAuthFailedCallback');
|
| 131 |
|
| 132 |
$rawACT = $this->getControllerACT($controllerName, $controllerClass);
|
| 133 |
if (is_null($rawACT) || empty($rawACT)) { return true; }
|
| 134 |
$ACT = $this->_auth->prepareACT($rawACT);
|
| 135 |
$roles = $this->_auth->getRolesArray();
|
| 136 |
$args = array($controllerName, $actionName, $controllerClass, $ACT, $roles);
|
| 137 |
|
Filename: D:\wwwroot\curtismen\wwwroot\lib\flea\FLEA.php [816]
#2 FLEA_Dispatcher_Auth::dispatching()
ARGS:
Array
(
)
SOURCE CODE:
| 806 |
require_once($MVCPackageFilename);
|
| 807 |
}
|
| 808 |
FLEA::init();
|
| 809 |
|
| 810 |
// 载入调度器并转发请求到控制器
|
| 811 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
| 812 |
FLEA::loadClass($dispatcherClass);
|
| 813 |
|
| 814 |
$dispatcher =& new $dispatcherClass($_GET);
|
| 815 |
FLEA::register($dispatcher, $dispatcherClass);
|
| 816 |
$dispatcher->dispatching();
|
| 817 |
}
|
| 818 |
|
| 819 |
/**
|
| 820 |
* 准备运行环境
|
| 821 |
*
|
| 822 |
* @param boolean $loadMVC
|
| 823 |
*/
|
| 824 |
function init($loadMVC = false)
|
| 825 |
{
|
| 826 |
static $firstTime = true;
|
Filename: D:\wwwroot\curtismen\wwwroot\index.php [42]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 32 |
),//配置模版引擎的一些参数
|
| 33 |
'dbTablePrefix'=>$dbname,
|
| 34 |
'defaultLanguage'=>$style,
|
| 35 |
);
|
| 36 |
|
| 37 |
FLEA::loadAppInf($dsn);
|
| 38 |
|
| 39 |
FLEA::setAppInf('urlMode', URL_PATHINFO);//URL_REWRITE
|
| 40 |
$_base=&FLEA::getSingleton('model_base');
|
| 41 |
$base=$_base->base();//所有页面都要用到的信息
|
| 42 |
FLEA::runMVC();
|
| 43 |
?> |