add transaction/summary, fix transaction/index, add reception product typeahead
This commit is contained in:
@@ -42,7 +42,7 @@ class ProductController extends Controller
|
||||
],
|
||||
'access' => [
|
||||
'class' => \yii\filters\AccessControl::className(),
|
||||
'only' => [ 'sale','payout-customer-cart','payout-user-cart', 'lookup'],
|
||||
'only' => [ 'sale','payout-customer-cart','payout-user-cart', 'lookup','find'],
|
||||
'rules' => [
|
||||
// allow authenticated users
|
||||
[
|
||||
@@ -82,6 +82,11 @@ class ProductController extends Controller
|
||||
$model->customer = $this->customer;
|
||||
$model->card = $this->card;
|
||||
|
||||
$products = Product::read();
|
||||
$products = Product::modelToMapIdName($products);
|
||||
|
||||
$model->products = $products;
|
||||
|
||||
if (Yii::$app->request->isAjax) {
|
||||
|
||||
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
|
||||
@@ -203,6 +208,23 @@ class ProductController extends Controller
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public function actionFind($id=null)
|
||||
{
|
||||
$result = [];
|
||||
$product = Product::findOne($id);
|
||||
$product = Product::modelToArray($product);
|
||||
|
||||
$result['product'] = $product;
|
||||
|
||||
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user